Pagini recente » Profil gedica | Diferente pentru utilizator/test.php intre reviziile 51 si 52 | Cod sursa (job #1296469) | Cod sursa (job #1296044) | Cod sursa (job #918453)
Cod sursa(job #918453)
#include <fstream>
using namespace std;
char c;
long long s1, s, nrlitere;
int main ()
{
ifstream f ("text.in");
ofstream g ("text.out");
while (f.get(c))
{
if (int (c) == 10) break;
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) s1++;
else
{
if (s1 != 0) s++;
nrlitere += s1;
s1 = 0;
}
}
g << nrlitere / s;
return 0;
}