Cod sursa(job #2139904)
Utilizator | Data | 22 februarie 2018 21:17:08 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char t;
int litere,cuvinte;
bool testlitera(char x)
{
if( (x>='a' && x<='z') || (x>='A' && x<='Z'))return 1;
return 0;
}
void citire()
{ bool intcuv=0;
while(f.get(t))
if(testlitera(t))
{
++litere;
if(!intcuv)++cuvinte,intcuv=1;
}
else intcuv=0;
g<<litere/cuvinte;
}
int main()
{
citire();
}