1、for循环
2、while循环
3、do-while循环
#include <stdio.h>
int main()
{
//print the month which user input
int days[]={31,28,31,30,31,30,31,30,31,30,31,30};
int month;
do
{
printf("Please input right figer of month:");
scanf("%d",&month);
}while(month<1||month>12);//处理不符合要求的输入数据
//Processing input data that does not meet requirements
printf("%d",days[month-1]);
return 0;
}