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

From AdonaiMedrado.Pro.Br
Revision as of 13:43, 1 April 2009 by 200.17.147.2 (Talk)

Jump to: navigation, search
#include <stdlib.h>
#include <stdio.h>
 
int main(){
 
   int entry, kaprekar, i;
   scanf("%d",&entry);
 
   for(i=10;i<=entry;i = i*10){
      kaprekar = entry/i + entry%i; 
      if (kaprekar*kaprekar == entry){
         printf("1")
         return 1;
      }
   }
   printf("0");
   return 0;
 
}