关于编程的
发布网友
发布时间:2022-04-25 17:05
我来回答
共1个回答
热心网友
时间:2023-10-21 14:20
(1)
#include "stdio.h"
int main(void){
char ch;
printf("Please enter a capital letter...\nch=");
if((ch=getchar())!=EOF && ch>='A' && ch<+'Z'){
printf("%c <--> %c\n",ch,ch+0x20);
return 0;
}
printf("Input error, exit...\n");
return 0;
}
(2)出这题的人肯定小学还没毕业!不然怎么说123的个位数是1、百位数是3?
#include "stdio.h"
int main(void){
int n;
printf("Please enter n(int 1000>n>99)...\nn=");
if(scanf("%d",&n)==1 && n>99 && n<1000){
printf("%d %d %d\n",n/100,n/10%10,n%10);
return 0;
}
printf("Input error, exit...\n");
return 0;
}