1 条题解

  • 0
    @ 2025-4-7 21:29:28

    C :

    #include<stdio.h>
    int main(void)
    {
    	int x;
    	scanf("%d",&x);
    	if(x<1)
    		printf("%d\n",x);
    	else
    	{
    	if(x>=10)
    		printf("%d\n",3*x-11);
    	else
    		printf("%d\n",2*x-1);
    	}
    	return 0;
    }
    

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int x,y;
    int main()
    {
    	cin>>x;
    	if(x<1)y=x;
    	else if(1<=x&&x<10)y=2*x-1;
    	else if(x>=10)y=3*x-11;
    	cout<<y;
       	return 0;
    }
    
    • 1

    信息

    ID
    1598
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者