// 14082008.cpp : Defines the entry point for the console application. //1) Imaginando que uma variável int em Ling.C só pode armazenar 0 ou 1, imprimir em tela 100 vezes a palavara oi. #include "stdafx.h" #include int j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12,j13,cont=1; int main(int argc, char* argv[]) { for(j1=0;j1<=1;j1++) { for(j2=0;j2<=1;j2++) { for(j3=0;j3<=1;j3++) { for(j4=0;j4<=1;j4++) { for(j5=0;j5<=1;j5++) { for(j6=0;j6<=1;j6++) { printf("Oi=%d -",cont); cont++; } } } } } } for(j7=0;j7<=1;j7++) { for(j8=0;j8<=1;j8++) { for(j9=0;j9<=1;j9++) { for(j10=0;j10<=1;j10++) { for(j11=0;j11<=1;j11++) { printf("Oi=%d -",cont); cont++; } } } } } for(j12=0;j12<=1;j12++) { for(j13=0;j13<=1;j13++) { printf("Oi=%d -",cont); cont++; } } return 0; } ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // 2).cpp : Defines the entry point for the console application. //Solicitar ao operador a digitação dos sinais "+","-" ou "." //se "+" imprimir do 1 ao 5 e parar //se "-" imprimir do 5 ao 1 e parar //se "." sair #include "stdafx.h" #include #include char tecla; int j,i; int main(int argc, char* argv[]) { do { tecla = getche(); switch(tecla) { case '+': for(i=1;i<=5;i++) { printf("\nI=%d",i); } break; case '-': for(j=5;j>=1;j--) { printf("\nJ=%d",j); } break; case '.': return 0; break; } }while(1); return 0; }