
仔细分析就会看出规律,这道题真唬人。
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
LL p;
scanf("%lld", &p);
if (p==1)
{
cout<<12<<' '<<4<<endl;
cout<<1<<' '<<2<<' '<<3<<' '<<6<<endl;
}
else
{
LL k = 6*p;
printf ("%lld 3\n",k);
printf ("%lld %lld %lld\n",p,2*p,3*p);
}
}
return 0;
}
本文揭秘一个C++编程题目背后的规律,涉及输入判断与输出模式。通过实例解析展示了如何利用`scanf`和`printf`处理特定数值,同时介绍了类型转换和条件逻辑。
539

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



