Skip to content

Instantly share code, notes, and snippets.

@HereChen
Created October 26, 2015 02:03
Show Gist options
  • Save HereChen/973f93a02b4a80d6c492 to your computer and use it in GitHub Desktop.
Save HereChen/973f93a02b4a80d6c492 to your computer and use it in GitHub Desktop.
input data -> save to array -> display
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int array[100][2], count, cina, cinb;
count = 0;
cout << "input:" << endl;
while ( cin >> cina >> cinb ){
array[count][0] = cina;
array[count][1] = cinb;
count++;
}
cout << "display:" << endl;
for (int i = 0; i < count; i++){
cout << array[i][0] << " " << array[i][1] << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment