diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..b103fcd Binary files /dev/null and b/.DS_Store differ diff --git a/王惠宇第三次上机作业/01.cpp b/王惠宇第三次上机作业/01.cpp new file mode 100644 index 0000000..8a88713 --- /dev/null +++ b/王惠宇第三次上机作业/01.cpp @@ -0,0 +1,30 @@ +#include +int main() +{ + int i,a,b,c; + float sum,average; + sum=0; + i=0; + average=0; + b=0; + c=0; + cout<<"ÇëÊäÈëÕûÊý£º\n"; + cin>>a; + while(a!=0) + { + sum=sum+a; + i++; + if(a>0) + b=b+1; + else + c=c+1; + cout<<"ÇëÊäÈëÕûÊý£º\n"; + cin>>a; + } + average=sum/i; + cout<<"ÓÐÕýÊý£º"< +int main() +{ + int x,a,b,c; + for(x=100;x<1000;x++) + { + a=x/100; + b=(x%100)/10; + c=x%10; + if(x==a*a*a+b*b*b+c*c*c) + cout< +int main() +{ + int x,sum,a; + for(x=1;x<1000;x++) + { + sum=0; + for(a=1;a +int main() +{ + int m,n,a,b,p,q; + cout<<"ÇëÊäÈëÁ½¸öÕýÕûÊým,n:\n"; + cin>>m>>n; + a=m; + b=n; + while(a%b!=0) + { + p=a%b; + a=b; + b=p; + } + for(q=1;q<=m*n;q++) + if((q%m==0)&&(q%n==0)) + break; + cout<<"×î´ó¹«Ô¼Êý£º"< +int main() +{ + int i,j,k; + for(i=1;i<=6;i++) + { + for(j=1;j<=(6-i)*2;j++) + { + cout<<' '; + } + cout; + for(k=i;k>0;k--) + cout< +int main() +{ + int i,j,k; + for(i=1;i<=6;i++) + { + for(j=1;j +#include +int main() +{ + int Amount,Years; + float yrate,mrate,mpay,tpay; + cout<<"Loan Amount:"; + cin>>Amount; + cout<<"Number of Years:"; + cin>>Years; + cout<<"Interest Rate"<<' '<<"Monthly Payment"<<' '<<"Totally Payment\n"; + for(yrate=0.05000;yrate<=0.08000;yrate=yrate+0.00125) + { + mrate=yrate/12; + mpay=(Amount*mrate)/(1-1/pow((1+mrate),Years*12)); + tpay=mpay*12*Years; + cout< +int main () +{ + int d,p,h,t,a,b,c,f; + for (d=4;d>=1;d--) + { + for (p=4;p>=1;p--) + { + for (t=4;t>=1;t--) + { + for (h=4;h>=1;h--) + { + a=((d==1)+(h==4)+(p==3)); + b=((d==4)+(h==1)+(p==2)+(t==3)); + c=((d==3)+(h==4)); + f=((d==3)+(h==2)+(p==1)+(t==4)); + if (a==1&&b==1&&c==1&&f==1&&d!=p&&d!=h&&p!=h&&p!=t&&h!=t&&t!=d) + { + cout <<"¶´Í¥ºþµÚ" <