#13015: d058


scottlu (呂鼎哥)

學校 : 臺北市私立延平高級中學
編號 : 69065
來源 : [203.72.178.252]
最後登入時間 :
2018-12-19 17:14:57

#include <iostream> 
using namespace std ;
int main () {
	int n ;
	while (cin >> n) {
		if (n>0) {
			cout << "1" << endl ; 
		}
		else if (n==0) {
			cout << "0" << endl ;
		}
		else {
			cout << "-1" << endl ;
		}
	}
	return 0 ;
}
Close
CPP

 

#15169: Re:d058


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50

#include  
using namespace std ;
int main () {
	int n ;
	while (cin >> n) {
		if (n>0) {
			cout << "1" << endl ; 
		}
		else if (n==0) {
			cout << "0" << endl ;
		}
		else {
			cout << "-1" << endl ;
		}
	}
	return 0 ;
}
Close
CPP

 

他說不要用if!!!