Cod sursa(job #2595579)
Utilizator | Data | 7 aprilie 2020 22:18:55 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<fstream>
#include <iostream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int n=100, aux=0,c=1, lm=0;
char a;
while (fin>> noskipws>> a) {
if (a == ' ') {
c++;
}
if (a != ' ' && a !=33 && a!=44 && a!=45) {
aux++;
}
cout << a;
}
lm = aux / c;
fout << lm<<" ";
return 0;
}