Cod sursa(job #1927832)
Utilizator | Data | 15 martie 2017 16:27:49 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char c;
int litere=0, cuvinte=0;
bool cuv=0;
while(f.get(c)){
if((c>='a'&& c<='z') || (c>='A' && c<='Z')){
if(!cuv) cuvinte++, cuv=1;
litere++;}
else cuv=0;}
cout<<litere<<" "<<cuvinte;
g<<(litere/cuvinte);
return 0;
}