3142:练23.4 首字母
C源码:
#include<stdio.h>
#include<stdlib.h>
int main()
{
char b;
scanf("%c",&b);
if(b=='a'){
printf("apple");
}
else if(b=='b'){
printf("banana");
}
else if(b=='c'){
printf("cat");
}
else{
printf("no");
}
return 0;
}
C++源码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
char c;
cin>>c;
if(c=='a') cout<<"apple";
else if(c=='b') cout<<"banana";
else if(c=='c') cout<<"cat";
else cout<<"no";
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
char ch;
cin>>ch;
if( ch=='a' )
{
cout<<"apple"<<endl;
}
if( ch=='b' )
{
cout<<"banana"<<endl;
}
if( ch=='c' )
{
cout<<"cat"<<endl;
}
if( ch!='a' && ch!='b' && ch!='c' )
{
cout<<"no"<<endl;
}
return 0;
}
python3代码:
n=input()
if n=='a':
print("apple")
else:
if n=='b':
print("banana")
else:
if n=='c':
print("cat")
else:
print("no")
3051:练10.3 计算浮点数相除的余(Scratch、C、C++)
3052:【例11.1】鸡兔同笼(Scratch、C、C++、python)
3052:【例11.1】鸡兔同笼(Scratch、C、C++、python)_3052:【例11.1】鸡兔同笼-CSDN博客
3053:【例11.2】数字对调(Scratch、C、C++、python)
3053:【例11.2】数字对调(Scratch、C、C++、python)_信息学奥赛一本通3053数字对调-CSDN博客
标签:python,Scratch,11.1,C++,else,首字母,3142,CSDN From: https://blog.csdn.net/dllglvzhenfeng/article/details/1413260873054:练11.1温度表达转化(Scratch、C、C++、python)