Cod sursa(job #2158093)
| Utilizator | Data | 10 martie 2018 10:27:30 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s[256];
f.getline(s,256);
int i = 0, nrcuv = 0, nrchars = 0;
while (!(s[i] >= 'a' && s[i] <= 'z') && !(s[i] >= 'A' && s[i] <= 'Z'))
++i;
while(s[i] != '\0')
{
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z'))
nrchars++;
else
nrcuv++;
i++;
}
g << nrchars/nrcuv;
return 0;
}
