Pages

Friday, July 29, 2011

d058: BASIC 的 SGN 函數


#include
#include
using namespace std;

int main()
{
int t;
while(cin >> t)
{
cout<<( t > 0 ? 1 : (t < 0 ? -1 : 0) );
}
return 0;
}

No comments:

Post a Comment