摘要:
//task2 //person.hpp #pragma once #include<iostream> #include<string> using namespace std; class Person { private: string name; string telephone; stri 阅读全文
摘要:
task2 //origin #include<iostream> #include<typeinfo> using namespace std; //definition og Graph class Graph { public: //声明时加入关键词virtual void draw() { 阅读全文
摘要:
task1-3 1. 学习了普通变量、指针、引用作为形参的用法,理解参数传递过程。 2. auto 自动推导类型 3. new,delete task4 //vector_int.hpp #ifndef VECTOR_INT_H #define VECTOR_INT_H #include<casse 阅读全文
摘要:
//info.hpp #ifndef INFO_HPP #define INFO_HPP #include<iostream> #include<string> using namespace std; class Info{ public: Info(string a,string b,strin 阅读全文
摘要:
task3 //Complex.hpp #ifndef COMPLEX_HPP #define COMPLEX_HPP #include <iostream> #include <cmath> using namespace std; class Complex { public: Complex( 阅读全文
摘要:
三 1.正确输出分数,生成文本文件file3.dat 2.用记事本程序打开文件file3.dat,数据信息正确,并且是直观可读的 四 1.正确输出了按分数由高到底排序的学生信息,在当前路径下,生成了二进制文件file4.dat数据信息不是直观可读的。 2. #include <stdio.h> #i 阅读全文
摘要:
一 #include <stdio.h> #include <stdlib.h> #include <string.h> #define N 3 typedef struct student { int id; char name[20]; char subject[20]; float perf; 阅读全文
摘要:
一 #include <stdio.h> const int N=3; int main(){ int a[N] = {1,2,3}; int i; printf("通过数组名及下标直接访问数组元素:\n"); for(i=0;i<N;i++) printf("%d:%d\n",&a[i],a[i] 阅读全文
摘要:
一 能,void-int,返回值为x1,x2; 二 #include <stdio.h> long long fac(int n); int main(){ int i,n; printf("enter n:"); scanf("%d",&n); for(i=1;i<=n;++i) printf(" 阅读全文
摘要:
一 #include <math.h> #include <stdio.h> int main(){ float a, b, c, x1, x2; float delta, real, imag; printf("Enter a, b, c:"); while(scanf("%f%f%f",&a, 阅读全文