Cod sursa(job #1363431)
Utilizator | Data | 26 februarie 2015 22:54:26 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main(){
ifstream f("text.in");
ofstream g("text.out");
char s[100000],*p;
int sum=0,nr=0,i,al=0;
f.get(s,100000);
i=0;
while(s[i]){
if(isalpha(s[i]))
al++;
while(isalpha(s[i]))
{
nr++;i++;
}
i++;
}
g<<nr/al;
return 0;
}