Cod sursa(job #1823386)
Utilizator | Data | 6 decembrie 2016 12:00:21 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
// Example program
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
char a,b,c[10]=" -.,'";
int n=0,s=0;
ifstream f("text.in");
ofstream g("text.out");
f>>a;
while(!f.eof())
{
f>>b;
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
{
if(strchr(c,b))
n++;
s++;
}
a=b;
}
g<<s/n;
}