第一题、
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a;
cin>>a;
if(a<=10)
{
cout<<a*2.2<<endl;
}
else
{
cout<<a*2<<endl;
}
system("pause");
return 0;
}
第二题、
int main()
{
int a;//申请变量“a”
cin>>a;//手动输入变量“a”的值
if(a%2==10)//设置if条件:如果a除以2的余数等于0(判断是否是偶数)
{
cout<<"Yes"<<endl;//如果是真,输出“Yes”
}
else//否则
{
cout<<"No"<<endl;//如果是假,输出“No”
}
system("pause");
return 0;
}
第三题、
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int t;
cin>>t;
if(20<=t&&t<=30)
{
cout<<"OK"<<endl;
}
else
{
cout<<"No"<<endl;
}
system("pause");
return 0;
}
第四题、
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int z;
cin>>z;
if(z<=10)
{
cout<<2.5<<endl;
}
else
{
cout<<2.5+(z-10)*1.5<<endl;
}
system("pause");
return 0;
}
第五题、
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int m;
int n;
cin m;
cin n;
if(m%n==0)
{
cout<<m/n<<endl;
}
else
{
cout<<m/n+1<<endl;
}
system("pause");
return 0;
}