Cod sursa(job #1129793)
Utilizator | Data | 28 februarie 2014 09:25:52 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
#include <cstring>
#include <ctype.h>
using namespace std;
int main(){ifstream f("text.in"); ofstream g("text.out");
unsigned int s=0,k=0; char v[100];
f.get(v,100); if(isalpha(v[0])) k++;
for(int i=1;i<=strlen(v);i++){if(isalpha(v[i])) s++;
if((isalpha(v[i]))&&(!isalpha(v[i-1]))) k++; }
g<<s/k;
}