char a[5],b[5] int i 在scanf输入的时候,scanf(%s %s %d,a,b,&i)可以通过空格符将输入隔开 比如 test test 1 //这个可以正常储存数据 testmore testmore 1 //即使溢出也可储存数据 testmore,test testmor ...
分类:
编程语言 时间:
2020-05-07 00:59:07
阅读次数:
187
(2):对printf scanf进行重定向且利用串口控制开发板上的LED灯(输入奇数LED1亮 偶数LED1灭) 重点:1.对c语言中的输入输出重定向必须配置keil使用微软lib库并且加入头文件stdio.h( #include<stdio.h> ) 2:重写fputc fgetc函数。 LED ...
分类:
其他好文 时间:
2020-05-06 21:59:58
阅读次数:
90
sscanf的作用:从一个字符串中读进于指定格式相符的数据。利用它可以从字符串中取出整数、浮点数和字符串。 sscanf和scanf的区别:scanf是以键盘作为输入源,sscanf是以字符串作为输入源(即处理已经输入的字符串) 原型: int sscanf(const char * str, co ...
分类:
其他好文 时间:
2020-05-06 20:09:33
阅读次数:
73
/* xuejineng2016@163.com 2020年5月6日 */ #include<stdio.h> int main(void) { int score; char grade; scanf("%d", &score); switch (score / 10) { case 10: ca ...
分类:
其他好文 时间:
2020-05-06 20:03:51
阅读次数:
72
题目 最大的异或 B君和G君聊天的时候想到了如下的问题。 给定自然数l和r ,选取2个整数x,y满足l include using namespace std; long long l, r; long long sum; int main(){ int T; scanf("%d", &T); wh ...
分类:
其他好文 时间:
2020-05-06 17:54:01
阅读次数:
54
1 /* 2 邮件:xuejineng2016@163.com 3 2020年5月5日 4 5 */ 6 #include<stdio.h> 7 int main(void) 8 { 9 int a, b; 10 scanf("%d %d", &a, &b); 11 12 printf("%d + ...
分类:
其他好文 时间:
2020-05-06 12:18:02
阅读次数:
67
注:本文使用的网课资源为中国大学MOOC https://www.icourse163.org/course/ZJU 93001 简单排序 前提 大多数情况下,为简单起见,讨论从小到大的整数排序 N是正整数 只讨论基于比较的排序( = 冒泡排序 基本思想 : 比较相邻的元素。如果第一个比第二个大,就 ...
分类:
编程语言 时间:
2020-05-05 17:35:38
阅读次数:
68
#include <stdio.h> //让n被i除(i的值从2到n-1)int main(){ int n,i; printf("please enter a integer number,n=?"); scanf("%d",&n); for(i=2;i<=n-1;i++) if(n%i==0) ...
分类:
其他好文 时间:
2020-05-05 12:49:00
阅读次数:
274
分块初始化: int a[50005];//原始序列 int l[2000];//第i个块的左区间端点 int r[2000];//第i个块的右区间端点 int pos[50005];//第i个点属于第几个块 int n; scanf("%d",&n); int dis=sqrt(n);//每一块的 ...
分类:
其他好文 时间:
2020-05-05 12:46:01
阅读次数:
46
使用floyd求取传递闭包,每次都进行判断 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=27; int g[N][N]; bool st[N]; int n,m; int d[N][N] ...
分类:
编程语言 时间:
2020-05-05 10:52:48
阅读次数:
62