大一c++编程期末考试

@夏柳17848284993 几道大一C++编程题 -
******3153华奔 // 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[]) ...

@夏柳17848284993 C程序(c++)期末考试~各位高手帮帮忙吧~求过程 谢谢~ -
******3153华奔 #include"stdio.h"#include"math.h"int f(int a){ int i,t=sqrt(a); for(i=2;i<=t;i++) if(a%i==0) return 0; return 1;}int he(){ int i,s=0; for(i=101;i<201;i+=2) if(f(i)!=0) s+=i; return s; }int main(){ int i,ss; ss=he(); printf("100-200的素数和为:%d\n",ss); return 0; }

@夏柳17848284993 C++期末考试求助
******3153华奔 #include <iostream> #include <cmath> using namespace std; void main() { int m; int n; int i; cout<<"Input m:"; cin>>m; n=m; for(i=0;n>0;i++) { n/=10; } for(;true;i--) { cout<<m/(int)pow(10.0,i-1); if(m>9) cout<<"$"; else break; m=m%(int)pow(10.0,i-1); } cout<<endl; }

@夏柳17848284993 大一C++期末考在即,跪求神告诉我为什么是这个输出结果 -
******3153华奔 这个需要仔细分析 有两个类,class A中含有纯虚函数,所以A是一个抽象类.class B :public A,类B公有继承了类A.并且对 virtual A*copy() const virtual void out() const 两个虚函数重新实现 搞清楚继承关系后,来分析main函数 B b; 对象在产...

@夏柳17848284993 大一C语言期末考试的试题大概是什么样子的?主要考什么? -
******3153华奔 主要考程序阅读题,重点在c语言函数、指针、数组应用几个方面,要掌握基础的编程方法,比如排序基本算法,后面要编程序的

@夏柳17848284993 关于c++的两道编程题(大一) -
******3153华奔 #include <iostream>const double PI = 3.1415926;using namespace std;struct Point {Point(){x = y = 0;}Point(double X, double Y):x(X), y(Y){};double x;double y; };class shape {public:virtual double GetArea()=0; // 虚函数,纯虚函数,...

@夏柳17848284993 C++编程题 -
******3153华奔 #include using namespace std; class person; class B { public: void outputData(person &p); }; class person{ protected: string nu; string na; public: friend void inputData(person &p); friend void B::outputData(person &p); }; void inputData(person &p) ...

@夏柳17848284993 C++编程题
******3153华奔 #include <iostream.h> int sumRow(int array[][4],int M,int N) { int min=0; int sumMin=0; for(int i=0;i<M;i++) { min=array[i][0]; for(int j=0;j<N;j++) { if(array[i][j] < min) { min = array[i][j]; } } sumMin+=min; } return sumMin; } int sumCol(int array[][4],int M,int N) ...

@夏柳17848284993 C++考试编程题 -
******3153华奔 据题意,程序如下:#include <iostream> using namespace std; int main() { int i,j,n; cin>>n; for(i=0;i<n;i++) { for(j=0;j<n;j++) if(i==0||i==j) cout<<'1'; else if(j<i) cout<<'s'; else cout<<'p'; cout<<endl; } return 0; }

@夏柳17848284993 C++编程题 3道
******3153华奔//------------------------------------------------------ #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(); } //--------------...

为传递更多信息,若有事情请联系
数码大全网