Cod sursa(job #1561752)
Utilizator | Data | 4 ianuarie 2016 15:04:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
using namespace std;
int l,cuv;
char c;
bool pc;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
while(f.get(c)){
if((c>='A'&&c<='Z')||(c>='a'&&c<='z')){
l++;
pc=true;
}
else if(pc){
pc=false;
cuv++;
}
}
if(pc)cuv++;
g<<l/cuv;
f.close ();
g.close ();
return 0;
}