Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1 test//
- #include <iostream>
- #include "supercalc.hpp"
- using namespace std;
- int main()
- {
- SuperCalc<int> sc(1, 11);
- sc(0, 10) = 0;
- for (int i = 0; i < 10; i++) {
- sc(0, 10) += sc(0, i);
- }
- for (int i = 0; i < 10; i++) {
- int x;
- cin >> x;
- sc(0, i) = x;
- }
- cout << (int)sc(0, 10) << endl;
- return 0;
- }
- ////////////////////////////////////////////////////
- //2 test///
- #include <iostream>
- #include "supercalc.hpp"
- using namespace std;
- int main()
- {
- SuperCalc<int> sc(1, 3);
- sc(0, 2) = -sc(0, 0) * sc(0, 1);
- sc(0, 1) = 300 - sc(0, 0);
- sc(0, 0) = 100;
- cout << (int)sc(0, 2) << endl;
- return 0;
- }
- ///////////////////////////////////
- //3 test////
- #include <iostream>
- #include "supercalc.hpp"
- using namespace std;
- int main()
- {
- SuperCalc<int> sc(1, 3);
- sc(0, 2) = (sc(0, 0) + sc(0, 1)) * (sc(0, 0) - sc(0, 1));
- sc(0, 1) = 2 * sc(0, 0);
- sc(0, 0) = 10;
- cout << (int)sc(0, 2) << endl;
- sc(0, 0) = 20;
- cout << (int)sc(0, 2) << endl;
- sc(0, 1) = 5;
- cout << (int)sc(0, 2) << endl;
- return 0;
- }
- //////////////////////////////
- //4 test///
- #include <iostream>
- #include "supercalc.hpp"
- using namespace std;
- int main()
- {
- SuperCalc<int> sc(5, 5);
- for (int j = 1; j < 5; j++) sc(0, j) = sc(0, j-1) + 1;
- for (int i = 1; i < 5; i++) {
- for (int j = 0; j < 5; j++) sc(i, j) = sc(i-1, j) + 1;
- }
- sc(0, 0) = 0;
- for (int i = 0; i < 5; i++) {
- for (int j = 0; j < 5; j++) cout << (int)sc(i, j) << " ";
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement