JIANRU啊
JIANRU啊
全部文章
分类
C++(1)
C语言(19)
PAT(13)
学习笔记(4)
数据结构(15)
归档
标签
去牛客网
登录
/
注册
JIAN
全部文章
(共52篇)
判断二进制数某位是0还是1,以及修改二进制数某位
#include <stdio.h> int main() { int n = 9; //判断n二进制数从右向左数第4位是0还是1,若为1,1&1得1,若为0,0&1得0; if((n>>(3))&1) printf(&quo...
2020-01-26
0
1367
华中科技大学计算机历年考研复试上机题
题目链接: https://www.nowcoder.com/ta/hust-kaoyan?page=1 1.矩阵转置 题目描述 输入一个N*N的矩阵,将其转置后输出。要求:不得使用任何数组(就地逆置)。 #include <iostream> #include <vecto...
2020-01-26
4
2547
农夫、狼、羊、菜过河问题
题目描述 有一个农夫带一只羊、一筐菜和一只狼过河。如果没有农夫看管,则狼要吃羊,羊要吃菜。但是船很小,只够农夫带一样东西过河。问农夫该如何解此难题? 输入描述: 题目没有任何输入。 输出描述: 题目可能有种解决方法,求出步骤最少的解决方法, 按顺序输出农夫想把羊、菜、狼全部运过河需要哪几个...
2020-01-26
0
1719
关联容器(set,multiset)
1. 关联容器 内部元素有序排列,查找速度快 除和顺序容器共有的成员函数外,还支持以下成员函数: find: 查找等于某个元素的值(x<y&&x>y同时为false) lower_bound: 查找某个下界 upper_bound: 查找某个上界 **equa...
2020-01-21
0
604
C++ String类介绍
1.对象初始化 string s("hello"); string s = "hello"; string s(8,'x'); 将字符赋值给string对象的方法: string s; s = 'n'; 2.相关操作及成员函数 1)长度 int...
2020-01-20
0
820
多态应用实例一:几何形体程序
用基类指针数组存放派生类对象的指针地址,是多态的常用应用,遍历该指针数组就能对各个派生类对象做各种操作。 problem 输入不同几何形体及其参数,要求按照面积大小顺序输出其对应的面积,以及集合形体形状。 code #include <iostream> #include <...
2020-01-16
0
648
1037 Magic Coupon (25 分)(PAT甲级)
The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a produc...
2019-09-02
0
596
1036 Boys vs Girls (25 分)(PAT甲级)(C语言)
This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. In...
2019-08-30
0
570
1035 Password (20 分)(C语言)(PAT)
To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords ...
2019-08-29
0
571
1031 Hello World for U (20 分)(PAT)(C语言)
Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l...
2019-07-28
0
635
首页
上一页
1
2
3
4
5
6
下一页
末页