Cod sursa(job #1510682)
| Utilizator | Data | 25 octombrie 2015 15:04:59 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<ctype.h>
using namespace std;
char c;
int nrc, nrs, nrcuv,i;
int main() {
ifstream f("text.in");
ofstream g("text.out");
while (f>>c)
{
if ((c >= 'a'&& c <= 'z') || (c >= 'A'&& c <= 'Z'))
nrc++;
else
if (c == ' ' || c == '-' ||c=='!')
nrs++;
}
nrs--;
nrs--;
nrcuv = nrc / nrs;
g << nrcuv;
system("pause");
return 0;
}
