实验1嗷

#include <stdio.h>
int main(){
    int x;
    
    printf("输入一个整数:\n");
    scanf("%d",&x);
    
    if(x%2==1)
        printf("是奇数");
    else
        printf("是偶数");
    
    
    return 0;    
} 
#include <stdio.h>
int main(){
    int days;
    
    printf("输入一个整数:\n");
    scanf("%d",&days);
    
    if(days<=5&&days>=1)
        printf("workdays,fighting\n");
    else if(days==6||days==7)
        printf("weekend,relax~\n");
    else
        printf("Ooops,not in 1~7\n"); 
    
    return 0;    
} 

分享图片

#include <stdio.h>
int main(){
    char ch; 
    
    printf("输入一个字符:\n");
    scanf("%c",&ch);
        if(ch>=97&&ch<=122)
            ch=ch-32;
        
    
        printf("%c\n",ch); 
    return 0;    
} 

分享图片

相关文章
相关标签/搜索