c++編程題庫(kù)100題
只風19810555188咨詢: C++編程練習題 -
池州市際廓線回復:
______ #include "stdio.h" void main() { int a[12],i; int month=0; int sum=0; float aver; printf("Input planned quantity for each month:"); for(i=0;i<12;i++) scanf("%d",&a[i]); for(i=0;i<12;i++) { sum=sum+a[i]; month++; if(sum>200) break; } printf("Total ...
只風19810555188咨詢: 一道C++編程題
池州市際廓線回復:
______ 就是一直滿足array[i][j]=array[j][i]... #include<iostream> using namespace std; void main() { int array[10][10];int i,j,k=0; cout<<"請輸入一個十階矩陣:"<<endl; for(i=0;i<10;i++) for(j=0;j<10;j++) cin>>array[i][j]; for(i=0;i<10;i++) for(j=0;j<10;j++) { ...
只風19810555188咨詢: C++編程題 3道
池州市際廓線回復:
______ //------------------------------------------------------ #include<iostream> using namespace std; class kkk{ int x,y; public: kkk(int ix, int iy):x(ix),y(iy){} void print(){ cout<<(x+y)<<endl;} }; void main(){ int x,y; cin>>x; getchar(); cin>>y; kkk k(x, y); k.print(); } //--------------...
只風19810555188咨詢: 急求 編程題C++
池州市際廓線回復:
______ 隨手寫的 有問題可以找我 如果滿意的話 記得選滿意答案哦 第一題 #include <iostream.h> void main() { int sum=0; for(int i=1;i<=100;i++) if(i%2) sum+=i; cout<<"奇數和為:"<<sum<<endl; } 第二題 #include <iostream.h> void main() { for(int j=1;j<=5;j++) for(int i=1;i<=j*2-1;j++) cout<<"*"; cout<<endl }
只風19810555188咨詢: C++編程題
池州市際廓線回復:
______ char next, n1, n2, n3; while(!fin.eof()) { fin.get(next); if(next == 'c') { fin.get(n3); fin.get(n2); fin.get(n1); fout << next << n3 << n2 << n1; if (n3 == 'i' && n2 == 'n' && n1 == ' ') { fin.get(next); if(next == '<') next = '>'; fout << next << next; fin.get(next); } else...
只風19810555188咨詢: 幾道大一C++編程題 -
池州市際廓線回復:
______ // 11題#include <stdio.h> void fun(char str1[],char str[]) { /***********begin***********/ int i,j; j = 0; for(i = 0;i < strlen(str1); i = i + 2) { str1[j] = str[i]; j++; } str1[j] = '\0'; /************end************/ }// 12題#include <string.h>#include <stdio.h> int fun(char str1[]) ...
只風19810555188咨詢: 滿分200分求C語言編程,簡單題 -
池州市際廓線回復:
______ 第一題: #include "stdio.h" main() { int i,j,k; for(i=0;i...
只風19810555188咨詢: 求一C++的編程題答案 -
池州市際廓線回復:
______ 來自:http://sunner.cn/courses/C/lab/goldbach.c 內容如下 /* Name: 哥德巴赫猜想驗證 Copyright: GPL Author: Sunner Sun Date: 01...
只風19810555188咨詢: c語言編程題目 -
池州市際廓線回復:
______ #include main(){ int i,j; for(i=0;i<100;i++) { for(j=2;j<=i;j++) if(i%j==0) break; if(j==i) printf("%d\n",i);}}...
只風19810555188咨詢: 一道C++編程題, 謝謝啦! -
池州市際廓線回復:
______ 請編寫函數fun.其功能是:計算并輸出3到m之間所有素數的平方根之和. 例如,若主函數從鍵盤給m輸入50后,則輸出為s=63.665791. 請勿改動主函數main與其他函數中任何內容,僅在函數的花括號中填入所編寫的若干語句.注意:m的值要大于2但不大于100.部分源程序給出如下. 試題程序: #include "math.h"