[ create a new paste ] login | about

Link: http://codepad.org/BowfSESU    [ raw code | output | fork ]

C++, pasted on Jul 2:
#include <iostream>
using namespace std;
const int n = 10;
int main() {
  int s[n][2];
  for (int i = 0; i < n; i++) {
    cout << i << ": ";
    cin >> s[i][0];
  }
  for (int i = 0; i < n; i++) {
    s[i][1] = 0;
    for (int j = 0; j < n; j++) {
      if (s[i][0] < s[j][0])
        s[i][1]++;
    }
    s[i][1]++;
  }
  for (int i = 0; i < n; i++)
    cout << "s[" << i << "]: " << s[i][1] << endl;
  return 0;
}
/* end */


Output:
1
2
3
4
5
6
7
8
9
10
0: 1: 2: 3: 4: 5: 6: 7: 8: 9: s[0]: 10
s[1]: 7
s[2]: 1
s[3]: 2
s[4]: 8
s[5]: 6
s[6]: 4
s[7]: 3
s[8]: 8
s[9]: 5


Create a new paste based on this one


Comments: