zoukankan      html  css  js  c++  java
  • 判断奇偶数

     
    #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;
    }
  • 相关阅读:
    函数名的应用/列表推导式
    装饰器/内置函数
    函数的基础
    文件的改的操作
    常用str
    python 定时器 timer QTimer
    Python 2.7.16 pyinstaller3.0 生成exe可执行文件
    python 根据excel单元格内容获取该单元格所在的行号
    python 实现仪器LAN口通信(FLUKE 8846)
    VS2019 MSB8041 MSB8042 Error
  • 原文地址:https://www.cnblogs.com/hoganhuang/p/13997915.html
Copyright © 2011-2022 走看看