
C/C++
aiwode_haha
这个作者很懒,什么都没留下…
展开
-
发送字符与字符串v
#include"at91rm9200.h" void pio_init(){ AT91C_BASE_SYS->PIOA_PDR=0XC0000000; AT91C_BASE_SYS->PIOA_PSR=0XC0000000;}void pmc_init(){ AT91C_BASE_SYS->CKGR_MOR=0XFF01; while((AT91C_B原创 2012-12-21 16:00:35 · 1649 阅读 · 0 评论 -
对字符串的操作总结
#include"stdio.h"#include"string.h"int main(){ char word[20]; char *p; char a[]="hello"; printf("Please input a stirng:\n"); scanf("%s",word); //gets(word); printf("*********\n");原创 2011-10-21 18:41:17 · 389 阅读 · 0 评论 -
逆序输出字符串
#include"stdio.h"#include"string.h"int main(){ char word[20]; int num,i; printf("Please input a stirng:\n"); scanf("%s",word); num=strlen(word); for(i=0;i { printf("%c",word[nu原创 2011-10-21 18:41:59 · 558 阅读 · 0 评论 -
简单的静态链表
#include"stdio.h"struct student{ long number; float score; struct student * next;};void main(){ struct student a={10101,89.5},b={10103,90},c={10107,85},*head,*p; head=&a; a.next=&b原创 2011-10-21 18:43:49 · 432 阅读 · 0 评论 -
计算一个数的位数
#include"stdio.h"int jishu(int data);int main(){ int count; int n,i,j; int a[10]; printf("please input data:"); scanf("%d",&n); count=jishu(n); for(i=0;i { a[i]=n%10; n=n/1原创 2011-10-21 18:44:26 · 806 阅读 · 0 评论 -
冒泡排序
#include"stdio.h"#include"string.h"#define N 50struct student{ int number; char name[20]; int score; };void paixu(struct student a[],int n);//函数声明 int main(void){ struct studen原创 2011-10-21 18:45:21 · 536 阅读 · 0 评论 -
C语言中的基本数据类型
数据类型(整型)大小(字节数)int4short2long4unsigned int4unsigned short2unsigned long4char1原创 2011-10-21 18:55:32 · 534 阅读 · 0 评论 -
算法代码库
目录目录 1Graph 图论 3| DAG的深度优先搜索标记 3| 无向图找桥 3| 无向图连通度(割) 3| 最大团问题 DP + DFS 3| 欧拉路径O(E) 3| Dijkstra数组实现O(N^2) 3| Dijkstra O(E * log E) 4| BellmanFord单源最短路O(VE) 4| SPFA(Shortest Path原创 2011-10-21 21:11:40 · 6223 阅读 · 2 评论 -
#include"iomanip" 头文件用法
//setw(2)表示输出的数占两位//setfill('0')表示剩下的位数填充'0'//setprecision(3) (用于小数的精度) 表示输出的小数的精度为:占用三位#include"iostream"#include"iomanip" using namespace std;class Time{public: void set_time();原创 2011-12-22 15:37:39 · 1672 阅读 · 0 评论 -
VC调试快捷键
F5 全速运行(go)shift+F5 中止调试ctrl+F5 执行程序ctrl+shift+F5 restart(重新开始) F9 设置断点F10 单步调试开始ctrl+F10 运行到断点 F11 跳进函数shift+F11 跳出函数 ctrl+F7 编译F7 建立 ALT+F8 自动排列代码为标准格式原创 2012-09-28 17:23:03 · 710 阅读 · 0 评论 -
约瑟夫环问题
//约瑟夫环问题#include"stdio.h"#include"stdlib.h"#include"string.h"struct data{ int number; struct data *next;}; struct data *init_list();//建立一空的循环链表struct data *insert_list(struct data原创 2011-10-21 20:58:38 · 606 阅读 · 0 评论