ICode9

精准搜索请尝试: 精确搜索
  • c语言函数式宏、逗号表达式2021-05-22 10:02:40

    c语言函数式宏、逗号表达式 一般由逗号运算符连接的两个表达式“a, b”在语法上可以视为一个表达式,在表达式后面添加分号,就构成了表达式语句。 #include <stdio.h> #define puts_alert(str) (putchar('\a'), puts(str)) int main(void) { int n; printf("n = "); scanf

  • c语言 8-12021-05-21 22:33:52

    定义一个函数式宏diff(x, y),返回x, y的差。 1、 #include <stdio.h> #define diff(x, y) ((x) - (y)) int main(void) { int a, b; puts("please input two integers."); printf("a = "); scanf("%d", &a); printf("b = &

  • Codeforces Round #721 (Div. 2)题解2021-05-21 02:05:21

    比赛链接 wa得老惨了qwq,本来还以为只能一题,太惨了太惨了 A 给你一个n,求最大的k使得:   思路:求n二进制最高位对应的数-1 int n; void solve() { sd(n); int nn=n,val=1; while(nn) { val<<=1; nn>>=1; } val>>=1; pd(val-1); } B 给

  • 2021-05-112021-05-15 21:03:56

    1 from pwn import* 2 from LibcSearcher import * 3 io=remote('node3.buuoj.cn',26312) 4 elf=ELF("./ciscn_2019_c_1") 5 puts_plt=elf.plt['puts']//等于的是puts.plt的地址

  • 顺序表操作集合(初始化 创建 插入 删除 清空 销毁等)2021-05-13 17:31:51

    代码如下: 其中case 7 8 9的scanf函数中%号前均有空白,详细原因参考两次调用scanf函数的问题 若有错误和可以改进的地方,敬请评论区指正。 #include<stdio.h> #include<stdlib.h> #include<malloc.h> #include<string.h> #define LIST_INIT_SIZE 100 #define LIST_INCREMENT 10

  • c语言 5-92021-05-03 17:33:56

    1、 #include <stdio.h> #define NUMBER 1000 int main(void) { int i, j, num, a[NUMBER], max, b[11] = {0}; do { printf("num = "); scanf("%d", &num); if(num < 1 | num > NUMBER) prin

  • c语言中实现矩阵的转置2021-05-03 12:33:39

    c语言中实现矩阵的转置 1、 #include <stdio.h> int main(void) { int i, j, a[4][6], b[6][4]; puts("please input the elements of matrix a."); for(i = 0; i < 4; i++) { for(j = 0; j < 6; j++) { printf(&qu

  • c语言 5-112021-05-01 18:03:40

    1、 #include <stdio.h> int main(void) { int i, j, a[8][3] = {}; puts("please input the scores of the students."); for(i = 0; i < 6; i++) { for(j = 0; j < 2; j++) { printf("a[%d][%d] =

  • c语言5-10 求矩阵的乘积2021-05-01 13:01:27

    求3行4列矩阵和4行5列矩阵的乘积。 1、 #include <stdio.h> int main(void) { int i, j, k, a[3][4], b[4][5], c[3][5] = {0}; puts("please input the elements of matrix a."); for(i = 0; i < 3; i++) { for(j = 0; j < 4; j++)

  • CF1477A Nezzar and Board(数论)(代办)2021-04-28 22:02:06

    CF1477A Nezzar and Board void solve() { cin >> n >> m; for(int i=1;i<=n;i++){ scanf("%lld",&a[i]); } /// 2x - y /// ll d = 0; for(int i=1;i<=n;i++){ d = __gcd(d,(a[i]-a[1])); }

  • CF1365B 题解2021-04-25 21:32:12

    Luogu-CF1365B 题意分析 通过模拟样例,发现只要 \(b\) 中同时出现 \(0\) 和 \(1\),就可以实现在 \(n\) 次成功交换到位。 所以,我们只对 \(b\) 只为 \(0\) 或只为 \(1\) 时的情况考虑。 很容易发现,此时是不能交换的。那么当且仅当此时的 \(a_i\) 满足不下降才符合题目要求。 所以,根据

  • c语言 4-14 根据输入的整数,循环显示12345678902021-04-19 19:35:32

      1、while语句 #include <stdio.h> int main(void) { int i = 1, j; puts("please input an integer."); do { printf("j = "); scanf("%d", &j); if (j <= 0) puts("the range

  • c语言 4-7 编写一段程序,显示小于输入的整数的所有2的乘方。2021-04-19 10:33:17

      1、do语句 #include <stdio.h> #include <math.h> int main(void) { int i = 1, j; puts("please input an integer."); printf("j = "); scanf("%d", &j); do { if (pow (2, i) < j)

  • c语言4-6 输出小于输入值的所有正偶数2021-04-18 23:35:15

      输出小于输入值的所有正偶数。 1、while语句 #include <stdio.h> int main(void) { int i = 2, j; puts("please input an integer."); printf("j = "); scanf("%d", &j); while ( i <= j) { printf("%d

  • c语言4-4 对4-6程序进行修改,递减到1而不是0,当输入的值小于0时不进行换行2021-04-18 23:04:14

      1、原始程序 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); while (i >= 0) { printf("%d ", i--); } p

  • c语言中输出递减的偶数或者奇数2021-04-18 13:02:56

      1、奇数 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); while(i > 0) { if (i % 2) printf("%d &

  • c语言中程序的循环控制,for语句。2021-04-07 19:01:10

      c语言中程序的循环控制,for语句。 1、输出从任一正整数到0的所有数字。 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); for (i; i >= 0; i--) { prin

  • 2816. 判断子序列2021-04-03 19:33:38

    思路: 加粗样式 代码: # include<iostream> # include<cstring> # include<cstdio> # include<algorithm> using namespace std; const int N = 100010; int a[N],b[N]; int n,m; int main() { cin >> n >> m; for(int i = 0;i <

  • c语言中程序的循环控制(利用for循环输出某一整数的所有约数)2021-03-16 23:04:15

      1、 #include <stdio.h> int main(void) { int i, j; puts("please input an integer!"); printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i++ ) { if (j % i == 0) pri

  • 2020西湖论剑一道web题[网盘]2021-03-16 06:32:27

    题目: 一个网盘系统 图片: 解题手法 上传".htaccess"文件,改成可以执行lua脚本 内容为: SetHandler lua-script 编写lua脚本,而后进行get方式访问 require "string" --[[ This is the default method name for Lua handlers, see the optional function-name in t

  • c语言中循环控制语句 (do语句,限制用户输入数值的范围)2021-03-15 11:04:37

      c语言中循环控制语句(do语句,限制用户输入数值的范围) 1、 #include <stdio.h> int main(void) { int i; do { puts("please input an integer! the range is 0-2!"); printf("i = "); scanf("%d", &i); } while (i

  • c语言中循环控制语句(do语句),锁定输入值的范围2021-03-14 12:33:13

      1、 #include <stdio.h> int main(void) { int i; do { puts("please input the i value."); printf("i = "); scanf("%d", &i); if (i < 0 || i > 2) puts("th

  • c语言中循环控制语句(do语句)2021-03-14 10:02:02

      1、 #include <stdio.h> int main(void) { int i, j; do { puts("please input the i value:"); printf("i = "); scanf("%d", &i); if (i % 2) puts("odd");

  • c语言中获取变量的最后一位数字、两位数字2021-03-13 10:36:42

      1、获取变量的最后一位数字 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); printf("The last number of i is: %d", i % 10); retur

  • codeforces 704(div.2)D. Genius's Gambit2021-03-03 20:34:47

    D. Genius's Gambittime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputYou are given three integers

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有