1 solutions

  • 0
    @ 2025-11-5 18:47:13

    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

    Information

    ID
    19039
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By