No! (Quick exam, do some simple questions)

Source: Internet
Author: User

No! Time limit:MS | Memory limit:65535 KB
Describe

Judgment: Two number x, y positive and negative properties.

Requirements: You cannot use the comparison operator, which is "<", ">", "<=", ">=", "= =", "! =".

Input
There are multiple sets of data, one row for each group of data, and two digits x, y for each row.
X, Y is guaranteed to be within the int range.
Output
One
row for each set of data output.
If the two number is a positive and a negative, the output "signs is opposite"
If the same is positive or negative, the output "signs is not Opposot"
If unsure, output "signs can ' t be sure"
Output does not include quotation marks
Sample input
1 1-1 1
Sample output
Signs is not opposotsigns is opposite

Int:
1#include <iostream>2#include <cstdio>3#include <cstdlib>4 using namespacestd;5 intMain ()6 {7     intn,m;8      while(cin>>n>>m)9     {Ten         if(! (nm)) Onecout<<"signs can ' t be sure\n"; A         Else if(! (M*n+abs (m*n ))) -cout<<"Signs is opposite\n"; -         Else thecout<<"signs is not opposot\n"; -     } -}

String

1#include <iostream>2#include <cstdio>3#include <cstdlib>4 using namespacestd;5 intMain ()6 {7     Charn[ the],m[ the];8      while(cin>>n>>m)9     {Ten         if(n[0]=='0'|| m[0]=='0') Onecout<<"signs can ' t be sure\n"; A         Else if((n[0]!='-'&&m[0]=='-')|| (n[0]=='-'&&m[0]!='-')) -cout<<"Signs is opposite\n"; -         Else thecout<<"signs is not opposot\n"; -     } -}

No! (Quick exam, do some simple questions)

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.