Cod sursa(job #2275934)
Utilizator | Data | 3 noiembrie 2018 19:32:08 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
unsigned int i,k=0,t=0;
char s[100],*p;
int main(){
f.getline(s,100);
for(i=0;i<strlen(s);i++)
if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z')
k++;
p=strtok(s," ");
while(p!=0){
t++;
p=strtok(NULL," ");}
g<<k/t;
return 0;}