• 判断奇偶数


     
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <stdlib.h>



    int main() 
    {
        int a, b;
        scanf("%d %d", &a, &b);
        
         for(;a<=b;a++)
            {  
             if(a<=9)
              {
                    switch(a)
                    {
                        case 0: printf("zero "); break;
                        case 1: printf("one "); break;
                        case 2: printf("two "); break;
                        case 3: printf("three "); break;
                        case 4: printf("four "); break;
                        case 5: printf("five "); break;
                        case 6: printf("six "); break;
                        case 7: printf("seven "); break;
                        case 8: printf("eight "); break;
                        case 9: printf("nine "); break;
                        default:
                                break;
                    }  
               }
               else if(a<=b)
                {
                    if(a%2==0)
                    {
                        printf("even ");  
                    } 
                    else
                    {
                        printf("odd ");
                    }
                }
             }     
        return 0;
    }
  • 相关阅读:
    了解Onunload,onbeforeunload事件
    asp.net 获取客服端的Ip地址
    HttpWebRequest WebResponse 对象简单了解
    web 编辑word 之dsoframer控件
    web编辑word之dsoframer(二)
    WebClient 对象实现下载和上传
    jquery datagrid 后台获取datatable处理成正确的json字符串
    doc文档的web查看
    C#中处理字符串对象的函数
    类3-类的static属性
  • 原文地址:https://www.cnblogs.com/hoganhuang/p/13997915.html
Copyright © 2020-2023  润新知