❶ 在C++中怎么实现求X的Y次方
main(){ int x,y,sum; cin>>"input x:">>x>>endl; cin>>"input y:">>y>>endl; for(int n=0;n<=y;n++) sum*=x; cout<<"x^y="<<sum<<endl;} 楼上说的错了!!