#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
using namespace std;
int main() {
int s, v1, v2, t1, t2;
scanf("%d %d %d %d %d", &s, &v1, &v2, &t1, &t2);
if (((s*v1) + 2 * t1) > ((s*v2) + 2 * t2)) {
printf("Second\n");
}
else if (((s*v1) + 2 * t1) < ((s*v2) + 2 * t2)) {
printf("First\n");
}
else {
printf("Friendship\n");
}
//system("pause");
return 0;
}
本文展示了一个使用C++进行编程竞赛的示例代码,通过比较两个运动员完成比赛的时间来决定胜负。代码中包含了基本的输入输出操作、条件判断及字符串处理等知识点。
1265

被折叠的 条评论
为什么被折叠?



