int main()
{
int x , y
scanf("%d",&x)
if(x < 1)
{
y = x - 1
printf("%d %d\n", x, y)
}else if(x > 1 || x == 1){
y = 2 * x + 1
printf("%d %d\n", x, y)
}
}
import java.util.Scannerpublic class Test {
public static void main(String[] args) {
System.out.print("请输入 x=")
Scanner sc = new Scanner(System.in)
int x = sc.nextInt()
System.out.println("输出y=" +x)
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)