Cod sursa(job #1312837)
| Utilizator | Data | 9 ianuarie 2015 23:25:35 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.62 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char c;
int contor = 0 ;
while(f>>c)
if(c>=65 && c<=122 && c!=91 && c!=92 && c!=93 && c!=94 && c!=95 && c!=96)
contor++;
f.close();
ifstream f2("text.in");
int i = 0;
char s[1000],*p,sep[]=" ,!-";
f2.get(s,10000);
int nr=0;
p=strtok(s,sep);
while(p)
{
nr++;
p=strtok(0,sep);
} g<<contor/nr;
return 0;
}
