#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a,j,yp,t,zs;
cin >> n ;
while(n--)
{
int x, y, z;
cin >> x >> y >> z;
j=j+x;
yp=yp+y;
t=t+z;
zs=j+yp+t;
}
cout<<j<<" "<<yp<<" "<<t<<" "<<zs<<endl;
return 0;
}

除了缩进以外错哪了,蹲指点

2 comments

  • 有什么实力,这题,直接给我做细啊

    • @ 2023-12-14 22:46:30

      错哪了???谢谢,已经过了,但是很早以前的错解不知道错哪了

  • #include <bits/stdc++.h>
    using namespace std;
    
    int a, b, c;
    
    int main()
    {
    	int n;
    	cin >> n;
    
    	while (n -- )
    	{
    		int x, y, z;
    		cin >> x >> y >> z;
    		a += x, b += y, c += z;
    	} 
    	
    	cout << a << ' ' << b << ' ' << c << ' ' << a + b + c << endl;
    	
    	return 0;	
    }
    
    • 1

    Information

    ID
    573
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    291
    Accepted
    164
    Uploaded By