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)