POJ C + + programming problem # 200 output

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.