码迷,mamicode.com
首页 > 编程语言 > 详细

c语言for循环

时间:2015-04-22 09:28:14      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

#include<stdio.h>
#include<windows.h>
#include <limits.h>
#include <math.h>
void isyes()
{
    int num;
    scanf("%d",&num);
    switch(num)
    {
    case 28:
        {
            printf("彩票号码为%d,恭喜,你中了一等奖\n",num);
            break;
        }
    case 16:
        {
            printf("您中了二等奖");
            break;

        }
    default:
        {
            printf("你没有中奖");
        }


    }

}
int main(void)
{
    
    int i;
    printf("请输入彩票号码:");
    
    for(i=1;i<=10000;i++)
    {
        isyes();

    }
    
    getchar();
    getchar();


    return 0;

}

c语言for循环

标签:

原文地址:http://www.cnblogs.com/karmapeng/p/4446358.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!