fork download
  1. //16
  2. #include <stdio.h>
  3. int main(int argc, char const *argv[])
  4. {
  5. int a,b,ai,bi,i;
  6. scanf("%d %d",&a,&b);
  7. ai=0;
  8. bi=0;
  9. for ( i = 0; i==a;i++)
  10. {
  11. if (a%i==0)
  12. {
  13. ai=ai+i;
  14. }
  15. }
  16. for (i=0;i==b; i++)
  17. {
  18. if (b%i==0)
  19. {
  20. bi=bi+i;
  21. }
  22. }
  23. printf("%d %d\n",ai,bi );
  24. if (ai==b && bi==a)
  25. {
  26. printf("sim\n");
  27. }else{
  28. printf("não\n");
  29. }
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0s 9416KB
stdin
284 220
stdout
0 0
não