随笔分类 - 牛客
摘要:#include<bits/stdc++.h> using namespace std; int num, count1,count2,sum; int temp = 0,temp1 = 0; int a[100],b[100]; int* p; void fun(int b[]) { for (i
阅读全文
摘要:#include<iostream> #include<vector> #include<string> using namespace std; string str; #define N 8 int j = 0; /* int main() { while (getline(cin, str))
阅读全文
摘要:题目正文编写一个程序输入一个m*n的矩阵存储并输出,并且求出每行的最大值和每行的总和。 要求把每行总和放入每行最大值的位置,如果有多个最大值,取下标值最小的那一个作为最大值。 最后将结果矩阵输出。 输入输入的第一行包括两个整数m和n(1<=m,n<=100),分别代表矩阵的行和列的维数。 接下来的m
阅读全文
摘要:#include<bits/stdc++.h>using namespace std;string Password(string str) { int len = str.size(); int a[4] = {0}; int count = 0; int num = 0;//重复子串对数 for
阅读全文
摘要:HJ16 购物单#include<bits/stdc++.h> using namespace std; int main() { int n = 5,m =10; int w[6] = {0,20,10,10,30,40}; int v[6] = {0,5,2,1,5,7}; int b[n+1]
阅读全文
摘要:重点: 空格符匹配 ' ' 不是'\0' " "表示空格这个符号的首地址这是个指针char x x是字符 //x只能赋值一个字符char *y y是指针 //y可以赋值一串字符string s s是指针 s[0]是字符所以字符匹配可以if(x == s[o])不能(x == s) ‘0’ 0对应的A
阅读全文