👤
Anndrero
a fost răspuns

Buna seara! Am rezolvat pb 132 in felul urmator, dar nu inteleg unde e greseala, caci iau 0 puncte pe ea.

#include <iostream>#include <cmath>#include <fstream>using namespace std;
int main(){    int n,i,v[21],x;    ifstream f("elempp.in");    ofstream g("elempp.out");    f>>n;    for (i=0;i<n;i++)        f>>v[i];    for (i=0;i<n;i++){        x=v[i];        while (x>=100)            x=x/10;        if (sqrt(x)*sqrt(x)==x)            g<<v[i]<<" ";    }    f.close();    g.close();    return 0;}


Buna Seara Am Rezolvat Pb 132 In Felul Urmator Dar Nu Inteleg Unde E Greseala Caci Iau 0 Puncte Pe Eainclude Ltiostreamgtinclude Ltcmathgtinclude Ltfstreamgtusi class=