急求C++6.0解题,1、编程求1到n中能被3或7整除的数之和。分别用for循环语句和while循环语句完成本题。

日期:2012-05-23 20:09:28 人气:1

急求C++6.0解题,1、编程求1到n中能被3或7整除的数之和。分别用for循环语句和while循环语句完成本题。

我有个类似的,发你研究一下吧。 #include using namespace std; int main() { int n; cout<<"enter the lenth of the side:"<<endl; cin>>n; for (int a=1;a<=n;a++) { for (int b=1;b<=n-a;b++) { cout<<" "; } for
    A+
热门评论