Skip to content

Instantly share code, notes, and snippets.

@yrchen
Created October 1, 2012 11:23
Show Gist options
  • Save yrchen/3811058 to your computer and use it in GitHub Desktop.
Save yrchen/3811058 to your computer and use it in GitHub Desktop.
2012 CE1001 A1-1
#include <iostream>
using namespace std;
int
main()
{
int len = 0, width = 0;
cout << "Please enter the rectangle length: ";
cin >> len;
cout << "Please enter the rectangle width: ";
cin >> width;
cout << "Perimeter is: " << (len + width) * 2 << endl;
cout << "Area is: " << len * width << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment