Cod sursa(job #656566)
Utilizator | Sima Cristian Black_Tiger | Data | 4 ianuarie 2012 20:17:34 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<iostream>
#include<fstream>
using namespace std;
std::ifstream f("text.in");
std::ofstream g("text.out");
int main(void){
int cuvinte=0, car=0;
char x;
bool este;
while(f.get(x))
{
if((x>='A' && x<='Z') || (x>='a' && x<='z'))
{
car++;
este = true;
}
else
if(este==true)
{
cuvinte++;
este=false;
}
}
g<<car/cuvinte;
return 0;
}