第5章第3讲常见编译错误与调试


#include "stdio.h"
main()
{

    int n;
    scanf("%d",&n);
    if(n%2=0)            //if(n%2==0)
         printf("该数是偶数!\n");
    else
         printf("该数是奇数!\n");

}


#include "stdio.h"
main()
{

    int x,y;
    scanf("%d",&x);
    if(x<0)
       y=0;
    else if(x<10) 
       y=2+x;
    else (x<20)      //  else if(x<20)
       y=3*x;
    else
       y=x;
    printf("%d\n",y);

}


#include "stdio.h"
main()
{

    int n;
    scanf("%d",&n);
    if(n%2==0)
         printf("该数是偶数!\n");
    else
         printf("该数是奇数!\n");

}

 

posted @ 2017-05-20 18:48  该☆隐  阅读(191)  评论(0编辑  收藏  举报