Program gives runtime error 6 (SIGABRT) on ideone.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
#include <vector>
using namespace std;
void check_ap_gp(int a, int b, int c)
{
if ( (b-a) == (c-b) )
cout<<"AP "<<c + (b - a);
else
cout<<"GP "<<c * (b / a);
}
int main()
{
int temp, flag = 0;
vector<int> tempo;
vector<vector<int> > v;
while(1) {
for (int i = 0; i < 3; i++) {
cin>>temp;
tempo.push_back(temp);
}
v.push_back(tempo);
if (tempo[0] == 0 && tempo[1] == 0 && tempo[2] == 0) {
break;
}
tempo.clear();
}
for (int i = 0; i < v.size() - 1; i++) {
check_ap_gp(v[i][0], v[i][1], v[i][2]);
if (i != v.size() - 2) cout<<endl;
}
return 0;
}
|
oh i think i uploaded the wrong code on ideone.com
thanks hamsterman:)
Topic archived. No new replies allowed.