Solução: Problema do quadrado gêmeo das partes (Marco Antônio)

From AdonaiMedrado.Pro.Br
Revision as of 12:33, 1 April 2009 by 200.17.147.2 (Talk) (New page: <code lang="c"> #include <stdio.h> #include <stdlib.h> int main(){ int entry, num1, num2, krapekar,i; scanf("%d",&entry); for(i=10;i<=entry;i = i*10){ num1 = entry/i; ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#include <stdio.h>
#include <stdlib.h>
 
int main(){
   int entry, num1, num2, krapekar,i;
 
   scanf("%d",&entry);
   for(i=10;i<=entry;i = i*10){
      num1 = entry/i;
      num2 = entry%i;
      krapekar = num1 + num2; 
      if (krapekar*krapekar == entry){
         return 1;
      }
   }
   printf("0");
   return 0;
}