Cod sursa(job #1902129)
| Utilizator | Data | 4 martie 2017 13:46:50 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 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;
long long l;
f.get(c);
if(c>=65 && c<=90) l++;
if(c>=97 && c<=122) l++;
a=c;
while(f.good())
{ f.get(c);
if(c>=65 && c<=90) l++;
if(c>=97 && c<=122) l++;
if(c==' ') {if(a==' ') break;
else s++;}
a=c;
}
s++;
g<<l/s;
return 0;
}
