Programming Question # #: Output 200
Source: Peking University Online Program evaluation system POJ (Coursera statement: The exercises completed on POJ will not count to the final results of Coursera. )
Total time limit: 1000ms memory limit: 1024kB
Describe
Make the following code output a result of 200.
#include <iostream>using namespace Std;class number {public: int num; Number (int n=0): num (n) {}//complements your code here};int main () {number N1 (Ten), N2 (); Number n3;n3 = n1*n2; cout << Int (n3) << Endl; return 0;}
Input
No input required.
Output
The output result is 200.
Sample input
No input required.
Sample output
200
1#include <iostream>2 using namespacestd;3 classNumber {4 Public:5 intnum;6Number (intn=0): num (n) {}7 //Add your code here8 int operator* (Number &N) {9 return This->num *N.num;Ten } One //overloaded type conversion equation, cannot have return value A operator int() { - returnnum; - } the }; - - intMain () { -Number N1 (Ten), N2 ( -); +Number N3;N3 = n1*N2; -cout <<int(n3) <<Endl; + return 0; A}
POJ C + + programming problem # 200 output