Cod sursa(job #876059)
Utilizator | Data | 11 februarie 2013 11:15:35 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include<iostream>
#include<fstream>
using namespace std;
main(){
ifstream f1("text.in");
ofstream f2("text.out");
int nrc=0,nrcu=0,ir,rest;
char c;
while(f1.get(c)){
ir=c;
if((ir>=65)&&(ir<=159))
nrc++;
if(ir==32)
nrcu++;
if(ir==96)
nrcu++;
}
nrcu++;
rest=nrc/nrcu;
f2<<rest;
}