Pagini recente » Istoria paginii winter-challenge-2008/clasament | Cod sursa (job #3224069) | Cod sursa (job #2414005) | Cod sursa (job #673928) | Cod sursa (job #1044814)
#include <iostream>
#include <fstream>
char x;
using namespace std;
int q,s,m,g,flag=1,copq,cops;
int main()
{
ifstream i("text.txt");
ofstream t("text.out.txt");
while(i>>x&&flag==1)
{
copq=q;
if(x=='a'||x=='b'||x=='c'||x=='d'||x=='e'||x=='f'||x=='g'||x=='h'||x=='i'||x=='j'||x=='k'||x=='l'||x=='m'||x=='n'||x=='o'||x=='p'||x=='q'||x=='r'||x=='s'||x=='t'||x=='u'||x=='v'||x=='x'||x=='y'||x=='w'||x=='z')q++;
if(x=='A'||x=='B'||x=='C'||x=='D'||x=='E'||x=='F'||x=='G'||x=='H'||x=='I'||x=='J'||x=='K'||x=='L'||x=='M'||x=='N'||x=='O'||x=='P'||x=='Q'||x=='R'||x=='S'||x=='T'||x=='U'||x=='V'||x=='X'||x=='Y'||x=='W'||x=='Z')q++;
if(x==' ')s++;
if(x==' '&&copq==q)g++;
else g=0;
if(g==2)flag=0;
}
m=q/s;
t<<m;
i.close();
t.close();
return 0;
}