Cod sursa(job #2437924)
Utilizator | Data | 10 iulie 2019 18:56:58 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
// Example program
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream o("text.out");
char c;
int k,p;
bool wrd;
int main()
{wrd=false;
while(f.get(c))
{
if((c>='a' && c<='z') || (c>='A'&& c<='Z'))
{
k++;
wrd=true;
}
else
if(wrd)
{
wrd=false;
p++;
}
}
o<<k/p;
return 0;
}