Cod sursa(job #1630855)
Utilizator | Data | 5 martie 2016 11:42:15 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
using namespace std;
char x,n;
int s,s1;
bool w,t;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(f.get(x))
{
w=0;
if((x>='A' && x<='Z')||(x>='a' && x<='z')) {s++; w=1;t=1;}
if(w && n==' ') s1++;
else if(n==' ') s1--;
n=x;
}
s1++;
cout<<s1<<" "<<s;
g<<s/s1;
return 0;
}