![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
大一下(C语言)
洛水成诗
这个作者很懒,什么都没留下…
展开
-
字符数组的赋值
1、定义的时候直接用字符串赋值 char a[10]=”hello”; //sizeof(a)为10 或char a[]=”hello”; //sizeof(a)为6 注意:不能先定义再给它赋值,如char a[10]; a[10]=”hello”;这样是错误的!2、对数组中字符逐个赋值 char a[10]={‘h’,’e’,’l’,’l’,’o’}; //sizeof(a)为转载 2017-08-26 15:06:11 · 285 阅读 · 0 评论 -
大一下期末考试:进制转化
大一下期末考试:进制转化/* 十进制转化为二进制*/原创 2017-08-24 16:25:12 · 304 阅读 · 0 评论 -
大一下期末考试:排序问题
大一下:排序问题/*题目2:数组+冒泡排序=字符串排序*/ #include <stdio.h> #include <string.h> void sort(char a[][100],int n); int main() { char a[100][100]; int i,n; printf("the number:"); scanf("%d",&n); p原创 2017-08-24 16:21:56 · 674 阅读 · 0 评论 -
大一下期末考试:将数字字符和非数字字符组成的字符串中的数字提取出来
大一下期末考试:将数字字符和非数字字符组成的字符串中的数字提取出来#include <stdio.h> #include <stdlib.h> #include<string.h> #define N 100 main() { char str[N]={'a'}; int i,j; printf("Please input a string:"); scanf("%s原创 2017-08-24 16:19:45 · 2632 阅读 · 0 评论 -
大一下期末考试:输入一个整形数,按汉语习惯输出,如1052,一千零五十二
大一下:输入一个整形数,按汉语习惯输出,如1052,一千零五十二#include <stdio.h> #include <stdlib.h> #include<math.h> main() { int n; int a; int i=4,j,k; printf("Please input the number(n<=65535):"); scanf("%原创 2017-08-24 16:14:56 · 945 阅读 · 1 评论 -
大一下期末考试:大数存储 阶乘50!
大一下期末考试:大数存储 阶乘50!原创 2017-08-24 16:06:59 · 781 阅读 · 1 评论 -
大一下期末考试 : 大数存储 超长整数的加法
大一下期末考试 : 大数存储 超长整数的加法原创 2017-08-24 16:05:45 · 587 阅读 · 0 评论 -
大一下 关于结构体的知识点
http://c.biancheng.net/cpp/html/88.htmlstruct{ //没有写 stu char *name; //姓名 int num; //学号 int age; //年龄 char group; //所在学习小组 float score; //成绩 } stu1, stu2 = { "Tom", 12, 18, 'A原创 2017-08-29 09:23:32 · 302 阅读 · 0 评论 -
大一下期末考试:统计一行字符串中单词的个数
大一下期末考试:统计一行字符串中单词的个数#include <stdio.h> #include <stdlib.h> #define N 100 int main() { char strings[N]; char i,sum=1; printf("please input a string: "); gets (strings); if(strings[0原创 2017-08-24 16:13:23 · 901 阅读 · 0 评论