网站首页 站内搜索

搜索结果

查询Tags标签: cout,共有 1241条记录
  • 实验2 数组、指针与C++标准库

    四、实验结论 1.实验五#include <string> #include <iostream> #include <vector>using namespace std;class Info{public:Info(string nname,string co,string ct,int nn){nickname = nname;contact = co;city = ct;n = nn;}void print(){cout <<…

    2021/10/29 17:39:30 人评论 次浏览
  • Euclid法求两个数的最大公因数

    #include<iostream> using namespace std; int GCD(int x, int y) {return y == 0 ? x : GCD(y, x % y); } int main() {int x, y;x=GCD(169, 121);cout << "GCD(169,121)的最大公因数为:" << x << endl;y = GCD(202, 282);cout <…

    2021/10/29 6:09:34 人评论 次浏览
  • Euclid法求两个数的最大公因数

    #include<iostream> using namespace std; int GCD(int x, int y) {return y == 0 ? x : GCD(y, x % y); } int main() {int x, y;x=GCD(169, 121);cout << "GCD(169,121)的最大公因数为:" << x << endl;y = GCD(202, 282);cout <…

    2021/10/29 6:09:34 人评论 次浏览
  • 【C++ 一本通】2060:【例1.1】计算机输出

    代码: #include<iostream> using namespace std; int main() {cout<<"Hello World!"; } 输出: 运行结果:

    2021/10/28 22:12:02 人评论 次浏览
  • 【C++ 一本通】2060:【例1.1】计算机输出

    代码: #include<iostream> using namespace std; int main() {cout<<"Hello World!"; } 输出: 运行结果:

    2021/10/28 22:12:02 人评论 次浏览
  • C++不限制猜测次数的猜数字小游戏

    不知道算不算小游戏,感觉还挺有意思的 ***涉及到了随机数的产生,以系统时间为种子产生随机数 #include <iostream> #include <ctime> using namespace std;int main() { srand((unsigned int)time(NULL));int num=(rand()%100)-1;int cai=0;while(1){cout…

    2021/10/28 20:42:18 人评论 次浏览
  • C++不限制猜测次数的猜数字小游戏

    不知道算不算小游戏,感觉还挺有意思的 ***涉及到了随机数的产生,以系统时间为种子产生随机数 #include <iostream> #include <ctime> using namespace std;int main() { srand((unsigned int)time(NULL));int num=(rand()%100)-1;int cai=0;while(1){cout…

    2021/10/28 20:42:18 人评论 次浏览
  • B站黑马c++学习笔记

    1. 初识 1.1 常量#define day 7const int month 12;1.2 关键字2. 数据类型数据类型:给变量分配合适的内存空间2.1 整型2.2 sizeof关键字2.3 实型(浮点型) float f1 = 3.14f; double d1 = 3.14;2.4 字符型2.5 字符串型c风格: char str[] = "hello word"; c++…

    2021/10/28 17:10:37 人评论 次浏览
  • B站黑马c++学习笔记

    1. 初识 1.1 常量#define day 7const int month 12;1.2 关键字2. 数据类型数据类型:给变量分配合适的内存空间2.1 整型2.2 sizeof关键字2.3 实型(浮点型) float f1 = 3.14f; double d1 = 3.14;2.4 字符型2.5 字符串型c风格: char str[] = "hello word"; c++…

    2021/10/28 17:10:37 人评论 次浏览
  • 实验二数组、指针与c++标准库

    #include<bits/stdc++.h> using namespace std;class Info {private:string nickname;string contact;string city;int n;public:Info(string a,string b,string c,int d):nickname(a),contact(b),city(c),n(d){}void print(){cout<<"称呼: "…

    2021/10/28 1:11:37 人评论 次浏览
  • 实验二数组、指针与c++标准库

    #include<bits/stdc++.h> using namespace std;class Info {private:string nickname;string contact;string city;int n;public:Info(string a,string b,string c,int d):nickname(a),contact(b),city(c),n(d){}void print(){cout<<"称呼: "…

    2021/10/28 1:11:37 人评论 次浏览
  • 实验2 数组、指针与C++标准库

    1.实验任务1-41)普通数组、array、vector的相关性,以及,区别:a)数组和array的大小都是固定的,而vector的大小可以改变。b)数组和array存储在栈中,而vector存储在堆中。c)数组只能通过下标访问,而array和vector可以通过at函数访问。d)数组不允许将对象赋值给另一…

    2021/10/28 1:09:39 人评论 次浏览
  • 实验2 数组、指针与C++标准库

    1.实验任务1-41)普通数组、array、vector的相关性,以及,区别:a)数组和array的大小都是固定的,而vector的大小可以改变。b)数组和array存储在栈中,而vector存储在堆中。c)数组只能通过下标访问,而array和vector可以通过at函数访问。d)数组不允许将对象赋值给另一…

    2021/10/28 1:09:39 人评论 次浏览
  • C++公约数和公倍数

    【问题描述】计算任意两个正整数的最大公约数和最小公倍数 【输入形式】输入两个正整数 【输出形式】先输出对应的最大公约数,然后输出最小公倍数,中间用空格隔开 【样例输入】30 6 【样例输出】6 30 //公约数和公倍数 #include <iostream> using namespace std;…

    2021/10/27 22:12:42 人评论 次浏览
  • C++公约数和公倍数

    【问题描述】计算任意两个正整数的最大公约数和最小公倍数 【输入形式】输入两个正整数 【输出形式】先输出对应的最大公约数,然后输出最小公倍数,中间用空格隔开 【样例输入】30 6 【样例输出】6 30 //公约数和公倍数 #include <iostream> using namespace std;…

    2021/10/27 22:12:42 人评论 次浏览
扫一扫关注最新编程教程