Cod sursa(job #1656761)
Utilizator | Data | 19 martie 2016 19:17:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char ch;
int l,nrcuv,ok=1;
int main()
{
while(f.get(ch))
if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')) {l++; ok=0;}
else if (ok==0){ nrcuv++; ok=1;}
if(ok==0) nrcuv++;
g<<l/nrcuv;
return 0;
}