摘要: // vs2013操作 //可以用fopen 函数对文件进行操作 #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include<string.h> int main(){ char s[5000] = { 0 阅读全文
posted @ 2016-11-28 20:22 过不去的过去 阅读(87) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include<string.h>//结构体 struct student{ int age; int sex; char name[50]; };struct 阅读全文
posted @ 2016-11-25 23:21 过不去的过去 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 递归与循环有相同之处,但是区别很大;代码简洁,但是理解复杂 通过题目来使用循环和递归,观察区别 提示用户输入一个正整数n,求出并输出下列结果:1! + 2! + 3! + 4! + ... + n!要求:用至少两种方式实现(函数名自拟,函数个数不限)① 非递归② 递归 //非递归 int main( 阅读全文
posted @ 2016-11-24 15:28 过不去的过去 阅读(90) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include<stdlib.h>int add(int a, int b){ return a + b;}int Max(int a, int b){ int i; i=a > b ? a : b; return i;}int main(){ //指针指向函数 阅读全文
posted @ 2016-11-18 22:00 过不去的过去 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>int main(){ /* //c语言的定义是这样的 int a = 5; int *p; p = &a; //为了简洁性 int *p1 = &a; printf("%x\n",p1); printf("%x\n",p); 阅读全文
posted @ 2016-11-18 21:20 过不去的过去 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 一般情况下新手都会犯的错误 1,注意在c语言中的大小写是有区别的,但在windows系统中默认没有差别,但是有时候也会出现bug. 2.在编程的时候注意定义你所使用的变量 3,每行代码的结尾注意要有分号 4,scanf语句中的"&"号最容易遗漏 5,分清你所定义的数据类型,例如ni编写了一个int型 阅读全文
posted @ 2016-10-02 21:23 过不去的过去 阅读(657) 评论(0) 推荐(0) 编辑