|
|
back to boardWA #1 PLEASE HELP Posted by mihran 18 Oct 2007 19:39 # include <iostream.h> int main() { int W[21]; int N,a,b; cin>>N; if (N>=1 && N<=20) { for (a=0;a<=N-1;a++) cin>> W[a]; for (a=0;a<=N-2;a++) { for(b=a+1;b<=N-1;b++) { if (W[a]>W[b]) { W[a]=W[b]+W[a]; W[b]=W[a]-W[b]; W[a]=W[a]-W[b]; } } } cout << W[1]-W[0]; } return 0; } Re: WA #1 PLEASE HELP I think,you're the dunkey!!!!!!!!!!!! |
|
|