Cod sursa(job #1363446)
Utilizator | Data | 26 februarie 2015 23:10:14 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include <string.h>
#include <cstdio>
using namespace std;
int main(){
ifstream f("text.in");
ofstream g("text.out");
char s;
int sum=0,nr=0,i,al=0,k=1;
i=0;
while(!f.eof()){
f.get(s);
if(s==' ')
nr++;
if(isalpha(s))
al++;
i++;
}
g<<al/(nr+1);
return 0;
}