小埋社区

    • Login
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    测试一下

    编程
    1
    2
    192
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Bruce
      Bruce ACG last edited by

      #include <iostream>
      using namespace std;
      
      int main()
      {
      	int x;
      	int f(int x);
      	cin >> x;
      	cout << f(x) << endl;
      	return 0;
      }
      
      int f(int x)
      {
      	if (x == 0)
      		return 0;
      	else
      		return 2 * f(x - 1) + x * x;
      }
      
      1 Reply Last reply Reply Quote 0
      • Bruce
        Bruce ACG last edited by

        这里正常
        复制到QQ里就全乱了

        突然意识到x定义成unsigned int貌似好一点

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        © 2017-2022 小埋社区 All Rights Reserved | 皖ICP备17016228号-2