切水题结果被水题切

P1001 A+B Problem

MaskedFools_Sparkle @ 2024-03-15 22:20:57

呵呵,5个WA

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    a=abs(a);
    b=abs(b);
    cout<<a+b;
    return 0;
} 

by sad_desert @ 2024-03-15 22:22:43

不是为什么是ab的绝对值相加


by sad_desert @ 2024-03-15 22:23:13

a=abs(a);
b=abs(b); 这俩去了就行


by MaskedFools_Sparkle @ 2024-03-15 22:26:26

不是说|a|,|b|吗


by qw1234321 @ 2024-03-15 22:27:27

@ChenyuanLi 那只是数据范围,请仔细读一遍题面。


by MaskedFools_Sparkle @ 2024-03-15 22:28:10

emmmmmm......


by zhangzirui66 @ 2024-03-15 22:33:24

long long


by QILINLBL @ 2024-03-15 23:02:44

直接加就可以了


by ENJOuYang @ 2024-03-15 23:06:51

所以加绝对值是为了好看吗


by Cute_QiQi @ 2024-03-21 14:32:38

a = abs(a),b = abs(b)去掉就Okay了

求关


by bcbgszyzh @ 2024-03-21 20:56:46

@ChenyuanLi

请注意:


| 下一页