- 博客(11)
- 收藏
- 关注
原创 Android文件复制到自己电脑运行出错
在local.properties里面最后一行找到。local.properties里面路径错了。改成自己电脑里正确sdk位置就可以成功运行了。
2023-10-06 11:08:24
336
2
原创 Android Studio中R.id.xxx错误
由于Library工程的可以包含资源文件,编译会生成R文件,多个Library中可能出现id冲突的问题。Android studio中提供快速切换方法。在创建好的Library工程中,switch语句的case中,使用 R.id.xxx 也不行。对比普通工程和Library工程的R文件发现,Library工程的R文件常量缺少final。然而switch语句的case中 必须是常量,而此时的R.id.xxx为非常量,所以报错了。switch语句的case中,不允许使用 R.id.xxx。
2023-10-05 16:45:28
2804
2
原创 Code::Blocks
Code::Blocks出现A debugging check in this application has failed?虽然不懂,但好像有一个灰常easy的解决方法:Settings->Editor->font->choose->随意选择一个字体(eg:consolas->常规->12)->ok好像是因为修改了字体导致的,但我也没修改字体=.=Code::Blocks运行代码出现汉字乱码?Settings->Compiler->Ot
2022-05-13 21:37:56
2651
原创 strstr()函数
strstr()函数头文件:#include<string.h>用处:判断串2是否为串1的子串结果:如果是,则该函数返回 str1字符串从 str2第一次出现的位置开始到 str1结尾的字符串;否则,返回NULL形式:strstr(s1,s2);原型:char *strstr(const char *s1,const char *s2)const保护数据的安全,char *为了实现链式访问...
2021-04-26 19:36:34
274
原创 roof(开N次方以及上下取整)
开N次方pow()函数头文件:#include<math.h>形式:pow(x,y)格式:表示对x开y次方x,y,函数返回值都为double型y不可以为小数x,y不可同为0上下取整函数向上取整形式:floor(x)含义:floor(x)返回的是小于或等于x的最大整数,floor(x)是向负无穷大舍入返回形式:double型(c语言)eg:floor(-2.5)=-3向下取整形式:ceil(y)含义:ceil(x)返回的是大于x的最小整数,ceil()是向正无
2021-02-22 19:18:12
441
原创 Martian
这题讲火星人敲代码。。。就离谱DescriptionIn the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics. Every year, they would hold an Arithmetic Contest on Mars (ACM). The task of the contest is to calcul
2020-12-24 15:12:22
212
原创 Beautiful numbers(前缀和思想)
A - OlympiadDescriptionYou are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digitals are different (i.e. 12345 is beautiful, 11 is not b
2020-12-22 20:35:05
672
原创 Word Reversal
Word ReversalDescriptionFor each list of words, output a line with each word reversed without changing the order of the words.InputThe first line contains a positive integer indicating the number of cases to follow. Each case is given on a line contain
2020-12-11 07:07:32
271
原创 sort
sort使用sort,首先头文件:#include【在c++里要多加一个 using namespace std; 】形式:sort(first_pointer,first_pointer+n,cmp)有三个参数,第一个参数是写数组的首地址【一般写数组名即可】;第二个参数写首地址+数组长度n;第三个参数写比较函数的名称【自定义函数cmp】。如果第三个参数不写,则sort默认按数组升序排序。【eg:将数组a的0~n-1个元素按升序排序—— sort(a,a+n); 】如果要写降序排列要写一个
2020-12-09 06:33:06
2199
原创 素数打表
学到一个快速给数组里所有值赋上相同值的函数:头文件:#include赋值数组的代码是:memcpy(b,a,sizeof(a));【这个函数的功能为:将a上大小为size字节的顺序赋值到b上去】
2020-12-06 10:28:40
91
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人