5 条题解

  • 1

    注意到 (x<<3)+(x<<1) 等价于 x*10。 所以我们可以:

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	ios::sync_with_stdio(0);
    	cin.tie(0);
    	cout.tie(0);
    	int x;
    	cin>>x;
    	int ans=(x<<3)+(x<<1);
    	cout<<ans;
    	return 0;
    }
    
    • 0
      @ 2024-11-5 12:52:16

      #include<bits/stdc++.h>; using namespace std; int main() {int x,y; cin>>x; y==10*x; cout<<y<<endl; return 0; }

      • 0
        @ 2024-10-5 17:00:55

        这道题很简单的一道数学问题,but你要是直接写不是太简单了? so我们先用递归函数试试

        #include <algorithm> //STL通用算法
        #include <bitset>//STL位集容器
        #include <cctype>
        #include <cerrno>
        #include <iostream>
        #include <istream>//基本输入流
        #include <ostream> //基本输出流
        #include <queue>//STL队列容器
        #include <set> //STL 集合容器
        #include <istream>//基本输入流
        #include <ostream> //基本输出流
        #include <queue>//STL队列容器
        #include <set> //STL 集合容器
        #include <sstream>//基于字符串的流
        #include <stack> //STL堆栈容器    
        #include <stdexcept> //标准异常类
        #include <streambuf>//底输入/输出支持
        #include <string>//字符串类
        #include <utility> //STL通用模板类
        #include <vector>//STL动态数组容器
        #include <cwchar>
        #include <cwctype>
        using namespace std;
        int fucccfalculateTotalPrice(int x) {  
            // 基本情况:如果只有一个小朋友,票价是10元  
            if (x == 1) {  
                return 10;  
            }  
            // 递归情况:x位小朋友的票价是x-1位小朋友的票价加上一个小朋友的票价  
            else {  
                return fucccfalculateTotalPrice(x - 1) + 10;  
            }  
        }  
        int main(){
        int x; cin>>x;cout<<fucccfalculateTotalPrice(x); return 0;
        }
        
        • 0
          @ 2023-12-23 13:41:43

          #include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; cout<<x*10; return 0; }

          • 0
            @ 2023-12-22 13:21:43

            #include<iostream> using namespace std; int main() { cout<<hello world!<<endl; return 0; }

            • 1

            信息

            ID
            3
            时间
            1000ms
            内存
            256MiB
            难度
            2
            标签
            递交数
            276
            已通过
            172
            上传者