码迷,mamicode.com
首页 >  
搜索关键字:int 取值范围    ( 143948个结果
算法和空间复杂度分析
看代码: 1 int cal(int n) { 2 int sum = 0; 3 int i = 1; 4 for (; i <= n; ++i) { 5 sum = sum + i; 6 } 7 return sum; 8 } 从cpu角度来看,这段代码每一行都执行类似操作 读数据-运算-写数据 ...
分类:编程语言   时间:2021-06-02 12:25:48    阅读次数:0
AVL树, 平衡二叉搜索树, 平衡二叉树
#include <stdio.h> #include <stdlib.h> #include <time.h> #define max(a, b) ((a) > (b) ? (a) : (b)) typedef struct Node { int key, height; struct Node ...
分类:其他好文   时间:2021-06-02 12:24:05    阅读次数:0
实验五
任务一#include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a ...
分类:其他好文   时间:2021-06-02 12:17:51    阅读次数:0
CS61A discussion 1
讨论部分代码: # Q1: Jacket Weather? def wears_jacket_with_if(temp, raining): """ >>> wears_jacket_with_if(90, False) False >>> wears_jacket_with_if(40, Fals ...
分类:其他好文   时间:2021-06-02 12:09:33    阅读次数:0
实验五
#include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i] ...
分类:其他好文   时间:2021-06-02 12:09:15    阅读次数:0
实验五
#include <stdio.h> const int N=3; int main() { int a[N] = {1, 2, 3}; int i; printf("通过数组名和下标直接访问数组元素:\n"); for(i=0; i<N; i++) printf("%d: %d\n", &a[i] ...
分类:其他好文   时间:2021-06-02 12:07:29    阅读次数:0
1000F.One Ocurrence(可持久化线段树+思维)
这题很妙。 多去完成这种级别的题目,建模能力才会真正得到提高。 题解干完springboot活补。 #include<bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1;char c=getchar(); while ...
分类:其他好文   时间:2021-06-02 12:02:18    阅读次数:0
Java冒泡算法
public static void main(String[] args) { int[] arr = {4, 2, 5, 9, 1, 6, 8}; boolean flag = false; for (int i = 1; i <= arr.length; i++) { System.out.p ...
分类:编程语言   时间:2021-06-02 11:59:30    阅读次数:0
23种设计模式
一、设计模式常用的七大原则有:二十三中设计模式都脱离不开这些原则(规则) 1-单一职责原则(互不影响) 2-接口隔离原则 3-依赖倒转(倒置)原则(高层不依赖低层,高层为接口和抽象类,低层为实体类) 4-里氏替换原则 5-开闭原则 6-迪米特法则 7-合成复用原则 二、设计模式三大类: 1.创建型模 ...
分类:其他好文   时间:2021-06-02 11:46:05    阅读次数:0
c语言中统计字符串中数字字符出现的次数
c语言中统计字符串中数字字符出现的次数。 1、 #include <stdio.h> void int_count(char x[], int cnt[]) { int i; while(x[i]) { if(x[i] >= '0' && x[i] <= '9') { cnt[x[i] - '0'] ...
分类:编程语言   时间:2021-06-02 11:38:03    阅读次数:0
143948条   上一页 1 ... 51 52 53 54 55 ... 14395 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!