2393:启蒙练习-取余
编写程序读入两个整数x,y并输出x对y取余的结果。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x,y;
cin>>x>>y;
cout<<x%y;
return 0;
}
2394: 启蒙练习-四则运算1
读入三个数a, b, c输出a * (b + c - a)的值。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<a*(b+c-a);
return 0;
}
2395: 启蒙练习-函数1
请完成一份实现“ 读入x,计算 f=x2+2∗x+5f=x2+2∗x+5 ”,输出 f 值的程序。
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x;
cin>>x;
cout<<x*x+2*x+5;
return 0;
}
2396: