Cod sursa(job #812203)
Utilizator | Data | 13 noiembrie 2012 17:05:26 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c1,c2,s[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
long long nrlit,nrcuv;
int main()
{
c1=' ';
while(f.get(c2))
{
if( strchr(s,c2) != 0 ) nrlit++;
else if( strchr(s,c1) != 0) nrcuv++;
c1=c2;
}
g<<nrlit/nrcuv;
}