I am currently solving a problem linked https://www.spoj.com/problems/HS12MBR35 but don’t know why i am getting 0 points.It’s working fine on my IDE.Can you help me in what can i do to make the code better to make it run on spoj??
#include<iostream>
using namespace std;
int main() {
int t, n;
char type;
int x1, x2, y1, y2, r;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n;
for (int j = 0; j < n; j++) {
cin >> type;
if (type == 'p') {
cin >> x1 >> y1;
cout << x1 << y1 << x1 << y1 << "\n";
} else if (type == 'l') {
cin >> x1 >> y1 >> x2 >> y2;
cout << x1 << y1 << x2 << y2 << "\n";
} else {
cin >> x1 >> y1 >> r;
cout << x1 - r << y1 - r << x1 + r << y1 + r << "\n";
}
}
}
return 0;
}
Thank you
created
last reply
- 10
replies
- 1.2k
views
- 2
users
- 2
links