- 博客(8)
- 收藏
- 关注
原创 Matlab —— 基本操作与矩阵输入
Keywordiskeyword 用于查看matlab中的关键字answer : matlab预设变量 i , j : complex number(复数) Inf : ∞ eps :2.2204e-016 NaN :not a number piCalling Priority(From high to low)不要用 built-in function name ...
2018-07-30 18:20:20 6009
原创 初等排序——Selection Sort(2018.7.29)
Selection Sort(选择排序法)伪代码:selectionSort(A, N) for i 从 0 到 N - 1 minj = i for j 从 i 到 N - 1 if A[j] < A[minj] minj = j A[i] 与 A[minj] 交换对于选择排序法,与前两种排序方法类似,也分为已排序和未排...
2018-07-29 21:22:27 178
原创 日常出错的地方(不断更新)
1.scanf 输入 忘记地址符&常见的情况是运行之后不会出现结果 runtime error2.== is comparison,经常少打一个===是逻辑运算符, =是赋值这样编译也不会出错,运行的时候同样出不来结果之前有一种记法 判断 i 和 1 是否相等,一般写作 i == 1;,可以把常量写前边 1 == i 这样少写 = 编译器就会检查出来...
2018-07-27 19:23:06 133
原创 初等排序——Insertion Sort & Bubble Sort(2018.7.27)
Insertion Sort(插入排序法)伪代码:insertionSort(A, N) for i 从 1 到 N-1 v = A[i] j = i - 1 while j >= 0 且 A[j] > v A[j+1] = A[j] j-- A[j+1] = v插入法排序过程中,会将数组分为已排序部...
2018-07-27 19:10:34 407
原创 HUDOJ
2042#include<stdio.h>int main(){ int n,sheep[31],i; scanf("%d",&n); sheep[0]=3; while(n--){ scanf("%d",&i); int j=0; for(;j<i;j++)//不能用while(m--)否则会导致m=1时不进...
2018-07-14 19:37:43 477
原创 HDUOJ1048(字符串的输入输出)
#include<stdio.h>#include<string.h>int main(){ char a[10],b[200],c[10]; while(scanf("%s",a),a[0]!='E') { int i,k; memset(b,0,sizeof(b)); getchar(); ...
2018-07-14 12:54:14 247
转载 HDUOJ1002 大数加法
#include<stdio.h>#include<string.h>int main(){ char a[1000],b[1000],c[1001]; int i,j=1,p=0,n,n1,n2; scanf("%d",&n); while(n) { scanf("%s %s",a,b); printf("Case...
2018-07-14 12:36:48 260
原创 1089-1096(数据输入输出处理方法)
1089Input:The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.输入不说明有多少个input block ,以EOF为结束标志。解决方法:#include<stdio.h>int main(){...
2018-07-14 11:51:16 172
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人