Cod sursa(job #904766)
Utilizator | Cobuz Andrei classius | Data | 4 martie 2013 20:37:54 |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
//#include "stdafx.h"
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char a[1000000];
string txt;
int i,nrc=0,nrl=0,ok=0;
f.getline(a,1000000);
txt=a;
for(i=0;i<txt.size();i++)
{
if(txt.at(i)==' ') nrc++;
if((txt.at(i)>='a'&&txt.at(i)<='z')||(txt.at(i)>='A'&&txt.at(i)<='Z')) nrl++;
}
g<<nrl/(nrc+1);
return 0;
}