當前位置:編程學習大全網 - 編程軟體 - 編程遇到error C2447:"{":缺少函數標題(是否是老式的形式表?)怎麽解決?

編程遇到error C2447:"{":缺少函數標題(是否是老式的形式表?)怎麽解決?

#include<iostream>

using?namespace?std;

void?sort(int?x,int?y,int?z);//************************移出來

int?main()

{

int?x,y,z;

cin>>x>>y>>z;

sort(x,y,z);

return?0;

}

void?sort(int?x,int?y,int?z);

{int?temp

if(x>y){temp=x;x=y;y=temp;};

if(z<x)?cout<<z<<','<<x<<','<<y<<endl;

else?if?(z<y)?cout<<x<<','<<z<<','<<y<<endl;

else?cout<<x<<','<<y<<z<<endl;

}

樓主妳把上面那句移到main函數外面就好啦

  • 上一篇:扇貝編程學完能接活嗎
  • 下一篇:在四川大學讀人工智能專業是什麽體驗?
  • copyright 2024編程學習大全網