Difference between revisions of "Solução: Dobradura - OBI (Delson Rosario)"

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
(New page: <code> #include <stdio.h> main(){ int entrada,teste=1,saida,base,i,aux; scanf("%d",&entrada); while(entrada != -1){ base = 2; aux = 1; for(i=1;i<=en...)
 
 
Line 1: Line 1:
<code>
+
<code lang="c">
 
#include <stdio.h>
 
#include <stdio.h>
  

Latest revision as of 12:38, 29 April 2009

#include <stdio.h>
 
main(){
    int entrada,teste=1,saida,base,i,aux;
    scanf("%d",&entrada);
    while(entrada != -1){
         base = 2;
         aux = 1;
         for(i=1;i<=entrada;i++){
            base += aux;
            aux *= 2;
         }
         printf("Teste %d\n",teste);
         printf("%d\n",base*base);
         teste++;
         scanf("%d",&entrada);
    }
}