社区讨论

P7578 1分求助

灌水区参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@lo308vk2
此快照首次捕获于
2023/10/23 22:40
2 年前
此快照最后确认于
2023/10/23 22:40
2 年前
查看原帖
C
#include <bits/stdc++.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
long long x,y,z,k;
string s;
int main(int argc, char** argv) {
	cin>>k;
	while(k--)
	{
		cin>>s;
		if(s=="x-z")
		{
			cin>>y;
			z=y>>1;
			x=y+z;
		}
		else {
			cin>>z;
			y=z+z;
			x=y+z;
		}
		cout<<x<<" "<<y<<" "<<z;
	}
	
	return 0;
}

回复

1 条回复,欢迎继续交流。

正在加载回复...