|
|
back to boardAccess Violation ? (Test 1) #include<stdio.h> int n,i,exit,leftob=-1005,rightob=1005,temp; main() { scanf("%d %d",&n,&exit);
for (i=0;i<n;i++) { scanf("%d",&temp); if (temp<rightob && temp>exit) rightob=temp; if (temp>leftob && temp<exit) leftob=temp; }
if (leftob==-1005) leftob=exit; if (rightob==1005) rightob=exit;
if (exit>0) { if (leftob>0) printf("Impossible\n"); else printf("%d %d\n",exit,-2*leftob+exit); } else { if (rightob<0) printf("Impossible\n"); else printf("%d %d\n",2*rightob-exit,-exit); } scanf(" "); } Re: Access Violation ? (Test 1) Re: Access Violation ? (Test 1) int main() |
|
|