Advertisement
a53

Diferenta

a53
Jul 28th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <fstream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ifstream fin("diferenta.in");
  9. ofstream fout("diferenta.out");
  10. int n,m,a,d,i,j,nr;
  11. fin>>n>>m;
  12. for(i=1;i<=n;i++)
  13. {
  14. for(j=1;j<=m;j++)
  15. {
  16. fin>>a;
  17. nr=0;
  18. for(d=1;d<=sqrt(a);d++)
  19. if(a%d==0&&(d+a/d)%2==0)
  20. nr++;
  21. fout<<nr<<' ';
  22. }
  23. fout<<'\n';
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement