ICode9

精准搜索请尝试: 精确搜索
  • [CF1498F]Christmas Game2021-05-04 11:02:29

    题目 传送门 to CF 题目描述 两人轮流执行操作:选一个树上节点,其到根节点的距离至少为 k k k 。选节点上的若干物品,将它移动到 k

  • printf------scanf----getchar---putchar函数的使用2021-05-03 14:51:15

    1.printf 输出函数,返回的是字符个数 话不多说 直接上代码 int main() { printf("%d", printf("%d", printf("%d", 43))); return 0; } 该程序的打印结果为 2.scanf 输入函数 打印生日,例如输入20130523,输出年份=2013 月份=05 日期=23; int main() { int year = 0;

  • c语言 5-112021-05-03 13:02:41

    1、 #include <stdio.h> int main(void) { int i, j, a[6][2], b[2] = {0}, c[6] = {0}; puts("please input the elements of array a."); for(i = 0; i < 6; i++) { for(j = 0; j < 2; j++) { printf(&

  • 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-122021-05-01 19:05:36

    1、 #include <stdio.h> int main(void) { int i, j, k, a[2][4][3], b[4][3] = {}; for(i = 0; i < 2; i++) { for(j = 0; j < 4; j++) { for(k = 0; k < 3; k++) { printf("

  • CodeForces - 32B Borze【水题】2021-05-01 13:29:58

    题目链接:https://codeforces.com/contest/32/problem/B #include <iostream> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <climits> #include <cstring> #include <vector> #include &

  • 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++)

  • c语言中设置数组元素的个数2021-04-29 12:32:53

    c语言中数组元素的个数。 虽然通过对象式宏修改数组元素个数非常的方便,但是每次都需要对程序进行修改,然后重新编译执行。因此,我们可以定义一个比较大的数组,然后从头开始仅使用其中需要的部分。 1、 #include <stdio.h> #define NUMBER 1000 int main(void) { int i, j, num

  • HAL库使用printf2021-04-18 15:03:35

    用stm32cubemx配置好串口功能之后,想要使用printf函数进行打印输出的话,还需要自己添加一个重定向函数。 1 #ifdef __GNUC__ 2 /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf 3 set to 'Yes') calls __io_putchar() */ 4 #define PUT

  • 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 &

  • getchar()和putchar()2021-04-17 16:02:13

    #include <stdio.h> #include <stdlib.h> int main() { char ch; /*、putchar() a、 putchar函数的格式:putchar(ch) (其中ch可以是一个字符变量或常量,也可以是一个转义字符) b、putchar函数的作用:向终端输出一个字符。 (1)putchar函数只能用于单个字符的输出,且一次只能输出

  • 112021-04-13 19:51:12

    #include<stdio.h>#include<math.h>int main(){ int k,j,m; printf("please input a positive number\n"); scanf("%d",&m); /*printf("------------------------\n"); for(k=1;k<=2*m+1;k++) { for(j=1;j<=abs(m+1-k)

  • 终于解决STM32CubeIDE串口重定向!!!2021-04-02 21:32:44

      感恩感恩!   前期一直没有解决好的IDE串口重定向终于解决了!   参照这位KarmaStone大大的帖子【传送门】   首先还是老规矩,添加头文件 /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include <st

  • C++快读快写(适用于整数变量)模版(详细注释版)2021-03-04 20:29:20

    前言 快读快写就是通过一小部分的手动实现(当然要调一些函数),达到快速输入/输出的效果. 快读 思路 通过从头到尾读取字符,记录是否有负号,其余部分用累加器累加(注意不同数位的处理). 代码 template<typename T> inline void read(T &x) { // template的用法详见https://www

  • __int128 学习笔记2021-03-03 12:31:26

    今天学习到__int128 类型 这是一个处理大数的很奇妙的方法。 正常来说,unsigned long long 已经是可以定义的最大的类型了,但是如果数据范围超过了2^64 就会爆炸。如果要处理比其大一点又不是那么大的数,就可以使用__int128这个定义。 注意:__int128 并不是所有编译器都可以使用

  • 第三章 最简单的C程序设计--顺序程序设计2021-02-09 11:29:50

    //习题1.假如我国国民生产总值的年增长率为7%,计算10年后我国国民生产总值与现在相比增长多少百分比。计算公式为 p=(1+r)^n r为年增长率,n为年数,p为与现在相比的倍数。 #include <stdio.h> #include <math.h> //要用到pow函数 int main() { double p,r=0.07,n=10; p=pow(1

  • 键盘输入一个大写字母,要求改用小写字母输出,用puthchar和getchar函数编程。2021-02-08 13:32:31

    #include<stdio.h> int main() { char ch; ch=getchar(); if(ch<'A'||ch>'Z') { printf("输入的不是大写字母,请重新输入!\n"); } ch=ch+32; putchar(ch); putchar('\n'); }

  • 黑龙江农垦科技职业学院喜迎寒假多校联赛2(快乐ak场)E题题解2021-01-24 16:36:01

    题目链接: https://ac.nowcoder.com/acm/contest/11471/E 题目描述 这一天Kadia与Majiagou在教学弟, 突然提出了一个问题 给你一个超大的数字 让你从中删掉几位 怎么让他最小? 这种签到题不会还有人写不出来吧 不会吧不会吧 输入描述: 第一行输入一个整数N 1<=len(N)<=2×107

  • 递归法把一个整数通过字符串输出,谭浩强教材习题2020-12-19 15:34:05

    #include<stdio.h> void Convert(int n) { int i; if ((i = n / 10) != 0) Convert(i); putchar(n % 10 + '0'); } int main() { int number; printf("输入一个整数: "); scanf("%d", &number); pri

  • 练习1-92020-12-17 20:59:14

    只能判断一次,不能重复判断 # include <stdio.h> int main() { int c, n0 = 0; while((c = getchar())!=EOF) { if(c != ' ') putchar(c); if(c == ' ') { n0++; if(n0 <= 1) putchar(c); } } }

  • tcpl 1-92020-11-21 13:31:44

    #习题1-9##将输入中的连续多个空格替换为一个并输出```#include <stdio.h> /* Run this program on itself (this file) and the following string "    "  * will be only one blank long.  */ main () {     int    c;     while ((c = getchar()) != EOF) {  

  • 单调队列(数组优化?)P18862020-10-19 17:01:27

    class Deque{public: int a[maxn]; int pl=1,pr=0;}Deq;int a[maxn];int n,k;void solve(){ Deq.pl=1;Deq.pr=0; for(int i=1;i<=n;i++){ while(Deq.pr>=Deq.pl&&a[Deq.a[Deq.pr]]<a[i])Deq.pr--;//弹尾 Deq.a[++Deq.pr]=i;//入尾

  • C putchar getchar2020-07-05 09:08:17

    /* putchar函数,用于输出一个字符 getchar函数,用于输入一个字符A */ #include<stdio.h> int main(void) {     char a, b, c;     a = getchar();      //获取输入的一个字符     b = getchar();      //如果输入过程中输入回车,将保存成换行符占

  • [TJOI2015]弦论2020-05-16 09:08:43

    题目         点这里看题目。 分析         补习知识:         既然可以求出原串中不同的子串的个数,那么我们同样可以求出含重复子串的个数,同样是\(dp\):         \(g(u)\):从\(u\)节点出发含重复的子串的数量。         转移: \[g(u)=|end-p

  • Stringstream2020-05-11 09:05:01

    Stringstream \(stringsteam\)用于进行数据类型转换,\(<sstream>\)库定义了三种类:\(istringstream\)、\(ostringstream\)和\(stringstream\),分别用来进行流的输入、输出和输入输出操作。 接下来举一个栗子,通过这道题我们来介绍下从\(int\)转化为\(string\)的过程 Digits Sequence

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

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

ICode9版权所有