Technology Learning

导航

scanf 输出格式的问题!!!

#include <stdio.h>

void main( void )
{

 char c;
 int i;
 printf("input your choice:\n");
 scanf("%c",&c);
 while (c=='y')
 {
  printf( "\n\nEnter an int\n");
  scanf("%d",&i);
  printf("your input : %d\n",i);
  
  printf("input your choice:\n");
  scanf("%c",&c);

 }
}

结果:.......

input your choice:
y


Enter an int
12
your input : 12
input your choice:
Press any key to continue




posted on 2009-09-25 09:02  浔阳渔夫  阅读(442)  评论(2编辑  收藏  举报