Cod sursa(job #1902212)
| Utilizator | Data | 4 martie 2017 14:18:31 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char c,a;
int i,s=0,cod=0,coda;
long long l=0;
f.get(c);
if(c>=65 && c<=90) {l++;coda=1;}
if(c>=97 && c<=122) {l++;coda=1;}
a=c;
while(f.good())
{ f.get(c);
cod=0;
if(c>=65 && c<=90) {l++;cod=1;}
if(c>=97 && c<=122) {l++;cod=1;}
if(cod==0) {if(a==' ') break;
else if(coda==1) s++;}
a=c;
coda=cod;
}
g<<l/s;
return 0;
}
