黑马程序员技术交流社区

标题: 请问这段代码哪里错了,没法编译,谢谢 [打印本页]

作者: yyc1888    时间: 2019-12-24 23:14
标题: 请问这段代码哪里错了,没法编译,谢谢
#include <iostream>
#include <string>

using namespace std;
int main()
{
   string raptor_prompt_variable_zzyz;
   int heads;
   int n;
   int foots;
   int m;

   raptor_prompt_variable_zzyz ="input header number";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> m;
   raptor_prompt_variable_zzyz ="input footer number";
   cout << raptor_prompt_variable_zzyz << endl;
   cin >> n;
   if (foots % 2==1)
   {
      cout << "error foots number" << endl;   }
   else
   {
      if (foots/2<heads)
      {
         cout << "foots/2<heads" << endl;      }
      else
      {
         if (foots/4>heads)
         {
            cout << "foots/4>heads" << endl;         }
         else
         {
            m =foots/2-heads;
            n =heads-m;
            cout << "clock="+n+"and rabbit="+m << endl;         }
      }
   }

   return 0;
}






欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2