Cod sursa(job #1577154)
Utilizator | Data | 23 ianuarie 2016 11:48:02 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
char a[255],v[]="-_=+,./?!@#$%^&*();'\][{}|<> ",s[]=" -";
ifstream f("text.in");
ofstream g("text.out");
f.getline (a,100);
int i,k=0,c=1;
for (i=0;i<strlen(a);i++)
{
k++;
if (strchr(v,a[i]))
k--;
if (strchr (s,a[i]))
c++;
}
g<<k/c;
}