언어

0123456789(별찍기 응용)

파아랑새 2015. 10. 3. 09:00

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define text "0123456789"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
 int len = strlen(text);
 int k = len;
 int i,j;
 for(i=0;i<len;i++)
 {
  for(j=0; j<k; j++)
  {
   printf("%c", text[j]);
  }
  printf("\n");
  k--;
 }
 
 return 0;
}