摘要: 以下代码为例 #include<iostream>using namespace std;int main(){ int a,b,i,max; while(cin>>a>>b) { int z,v; z=a; v=b; do{ i=a%b; a=b; b=i; }while(i!=0); cout< 阅读全文
posted @ 2022-05-28 10:45 晚风与你 阅读(46) 评论(0) 推荐(0)
摘要: 以下代码简单为例 #include<iostream>#include<cmath>using namespace std;int main(){ int a; a=2; a=pow(2,4); cout<<a<<endl;; int b=3; b=b^2; cout<<b; } 在定义中先#inc 阅读全文
posted @ 2022-05-28 10:43 晚风与你 阅读(733) 评论(0) 推荐(0)
摘要: 代码如下 #include<iostream>#include<cmath>using namespace std;int main(){ int a,flag=0; int i=0; int n,m=0,z; while(i<1){ cin>>a; if(a<3||a>10000) continu 阅读全文
posted @ 2022-05-26 20:21 晚风与你 阅读(149) 评论(0) 推荐(0)
摘要: 以下代码为例 #include<iostream>using namespace std;int main(){ float a,b; while(cin>>a){ b=(5.0/9)*(a-32); cout<<b<<endl; } return 0;} 如此可以正确输出 按照整形(当b中写的是5 阅读全文
posted @ 2022-05-25 22:25 晚风与你 阅读(251) 评论(0) 推荐(0)
摘要: 以下面代码为例 #include<iostream>#include<iomanip>using namespace std;int main(){ double sum=0; float i,b=1; for(i=1;i<101;i++) { sum=((b/i)+sum); b=-b; }cou 阅读全文
posted @ 2022-05-25 21:55 晚风与你 阅读(1559) 评论(0) 推荐(0)