Cod sursa(job #1558817)
| Utilizator | Data | 29 decembrie 2015 16:55:01 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int k=0, cuv, ok, rez, c1;
char c;
cuv=1;
c1 = 0;
c1= ' ';
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
c=f.get();
ok=1;
if(c=='!' || c=='?' || c==',' || c==';' || c==':' || c=='.' || c=='<' || c=='>' || c=='"' || c==' ' || c=='(' || c==')' || c=='+' || c=='*' || c=='@' || (c<=9 && c>=0))
ok=0;
if(ok==1)
k++;
if(c==' ' || c=='-')
cuv++;
}
rez=k/cuv;
g<<rez;
f.close();
g.close();
}
