题目链接:http://exam.upc.edu.cn/problem.php?cid=1374&pid=1
题意:猜的。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m)){
int ans=(n+m)/2;
printf("%d\n",ans);
}
return 0;
}
本文解析了一个简单的算法题目,通过输入两个整数n和m,输出它们之和的一半(向下取整)。使用C++实现,适合初学者练习。
题目链接:http://exam.upc.edu.cn/problem.php?cid=1374&pid=1
题意:猜的。
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
while(~scanf("%d%d",&n,&m)){
int ans=(n+m)/2;
printf("%d\n",ans);
}
return 0;
}
210

被折叠的 条评论
为什么被折叠?
&spm=1001.2101.3001.5002&articleId=80387511&d=1&t=3&u=b724907f770f429d8c77e056ea591b71)