

#include <stdio.h>
int main()
{
int x,y;
printf("请输入x:");
scanf("%d",&x);
if(x>-5 && x<0)
y = x;
else if(x==0)
y = x-1;
else if(x>0 && x<10)
y = x+1;
else
y=100;
printf("y=%d\n",y);
return 0;
}
#include <iostream>
using namespace std;
int getmin(int);
int main()
{
int t1, t2;
cout<<"Enter two numbers: ";
cin>>t1>>t2;
cout<<"Subtraction (minute): "<<getmin(t2)-getmin(t1)<<endl;
return 0;
}
int getmin(int t)
{
if(t<100)
{
return t;
}else{
int tail = t%100;
int head = t/100;
return head*60 + tail;
}
}