C:多扫描,当我为一个扫描输入一个值时,它跳过了第二个扫描
#include <stdio.h>int main(){ char c = 'q'; int size; printf("\nShape (l/s/t):"); scanf("%c",&c); printf("Length:"); scanf("%d",&size); while(c!='q') { switch(c) { case 'l': line(size); break; case 's': square(size); break; case 't': triangle(size); break; } printf("\nShape (l/s/t):"); scanf("%c",&c); printf("\nLength:"); scanf("%d",&size); } return 0; }
printf
白猪掌柜的
泛舟湖上清波郎朗
慕无忌1623718
相关分类