Cod sursa(job #1333223)
| Utilizator | Data | 2 februarie 2015 21:54:28 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int nrc, nrt, ma=0, verif;
char ch;
bool verifyChar(char c)
{
return ((c>='a' && c<='z') || (c>='A' && c<='Z'));
}
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while (!f.eof()){
f.get(ch);
if(verifyChar(ch)){
nrt++;
verif=1;
}
else{
if(verif)
nrc++;
verif=0;
}
}
g << nrt / nrc;
return 0;
}
