网站首页 站内搜索

搜索结果

查询Tags标签: cout,共有 1241条记录
  • c++ bind ref 例子

    // bind example #include <iostream> // std::cout #include <functional> // std::bind// a function: (also works with function object: std::divides<double> my_divide;) double my_divide (double x, double y) {return x/y;}struct MyPa…

    2022/8/28 14:22:56 人评论 次浏览
  • AtCoder Beginner Contest 266 A-D

    AtCoder Beginner Contest 266 https://atcoder.jp/contests/abc266 EF 待补 A - Middle Letter 输出字符串最中间的那个字母 #include <bits/stdc++.h>using namespace std;int main () {string s;cin >> s;cout << s[(s.size()+1)/2-1]; }B - Modulo …

    2022/8/28 6:23:58 人评论 次浏览
  • C++ 数组作为函数的参数

    1.一个指针在32位操作系统上占4个字节,一个指针在64位操作系统上占8个字节,但是,编译器为了兼容32位操作系统和64位操作系统,所以指针都是4个字节长度。 下面程序中的形参本质上是一个指针,所以无论定义了几个参数都只能传递四个字节。#include <iostream> #in…

    2022/8/24 1:24:21 人评论 次浏览
  • c++ 跑酷小游戏之用户体验plus

    #undef UNICODE#undef _UNICODE#include <iostream>#include <iomanip>#include <string>#include <cstdlib>#include <ctime>#include <windows.h>#include <conio.h>#include <fstream>#include <stdio.h>using …

    2022/8/23 14:25:40 人评论 次浏览
  • 《《关于我把好好的c++小游戏改的很ex》》

    #undef UNICODE#undef _UNICODE#include <iostream>#include <iomanip>#include <string>#include <cstdlib>#include <ctime>#include <windows.h>#include <conio.h>#include <fstream>#include <stdio.h>using …

    2022/8/23 1:55:11 人评论 次浏览
  • C++ 黑客攻击系统

    #include <iostream> #include <Windows.h> #include <string> #include <conio.h> //getch使用 #include "hacker.h" using namespace std;#define WIDTH 40 #define HEIGHT 15void inputPwd(char pwd[], int size) {char c;int i = …

    2022/8/23 1:52:44 人评论 次浏览
  • c++ lambda学习举例

    #include <iostream> #include<vector> #include<algorithm> #include<cmath> #include<ctime> using std::cout; using std::vector; using std::srand; using std::time; using std::generate; using std::endl; using std::count_if; us…

    2022/8/22 1:55:34 人评论 次浏览
  • PAT Advanced 1027 Colors in Mars(20)

    题目描述: People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for…

    2022/8/21 6:56:34 人评论 次浏览
  • [2004年NOIP普及组] FBI树

    [2004年NOIP普及组] FBI树 思路:运用递归。已知“0”和“1”组成的字符串分为三类:全“0”串称为B串,全“1”串称为I串,既含“0”又含“1”的串则称为F串。 写一个后序遍历的函数,然后递归,自己调用自己就好了。每次输出根节点,直至全部输出。 代码如下: #include…

    2022/8/15 23:31:04 人评论 次浏览
  • 第7章 函数——C++的编程模块

    第7章 函数——C++的编程模块 7.8 编程练习题第1题#include <iostream> using namespace std;// 编写一个程序,不断要求用户输入两个数,直到其中的一个为0. // 对于两个数程序使用一个函数来计算它们的调和平均数,并将结果返回给main() // 调和平均数 = 2.0 * x…

    2022/8/15 1:53:58 人评论 次浏览
  • C++ while循环的简单易用 输入正确的账号密码

    #include <iostream> using namespace std; int main() {string name;string pwd;while (1){system("cls");cout << "请输入账号:";cin >> name;cout << "请输入密码:";cin >> pwd;if (name == "54hk&…

    2022/8/15 1:23:52 人评论 次浏览
  • 1.4 C++的for,new

    for,new等 遍历循环 取别名的方式最好 #include <iostream>using namespace std;int main() {int v[]{ 12,13,14,15 };for (auto x : v) {cout << x << endl;}cout << "-------------" << endl;for (auto x : { 17,18,19 }) {co…

    2022/8/13 1:26:19 人评论 次浏览
  • C++异步async

    #include <iostream> #include <future>int mythread() {std::cout << "mythread " << std::this_thread::get_id() << std::endl;std::chrono::milliseconds second(3000);std::this_thread::sleep_for(second);return 5; }int …

    2022/8/9 1:24:19 人评论 次浏览
  • 输入行数,用C++打印金字塔型星号

    #include <iostream> #include <windows.h> #include <string> using namespace std; int main() {int row;cout << "请输入行数:";cin >> row;for (int i = 1; i <= row; i++) {for (int k = 0; k < row - i; k++) {cout…

    2022/8/9 1:22:48 人评论 次浏览
  • C++用短除法把十进制转换为二进制输出

    #include <iostream> #include <Windows.h> #include <string> using namespace std; int main() {int n;int ret[32];int i = 0;cout << "请输入一个正整数:";cin >> n;if (n < 0) {cout << "需要输入一个正整数…

    2022/8/9 1:22:46 人评论 次浏览
扫一扫关注最新编程教程