1299. bplusa
☆ 输入文件:bplusa.in 输出文件:bplusa.out 评测插件
时间限制:1 s 内存限制:128 MB
【题目描述】
输入一个整数n,将其拆为两个非负整数a,b,使a,b的和等于n。
【输入格式】
输入数据只有一行,为一个整数。
【输出格式】
输出数据只有一行,两个整数,中间用一个空格隔开。
【样例输入】
5
【样例输出】
2 3
题目链接:cogs.cf/cogs/proble…
分析:这题好像怎么输出都能过?确实是这样的呢,我试了下,输出0,n也能AC,(^-^)V纯属娱乐题hhh
下面给出AC代码:
1 #include <bits/stdc++.h>
2 using namespace std;
3 typedef long long ll;
4 ll n;
5 int main()
6 {
7 freopen("bplusa.in","r",stdin);
8 freopen("bplusa.out","w",stdout);
9 cin>>n;
10 /*
11 if(n%2==0)
12 {
13 cout<<n/2<<" "<<n/2<<endl;
14 return 0;
15 }
16 cout<<n/2<<" "<<n-n/2<<endl;
17 */
18 cout<<0<<" "<<n<<endl;
19 return 0;
20 }