摘要:
采用的开发平台是Android Studio 问题一: 软件安装比较简单,可是建立第一个工程后一直显示BUild Download Gradle,,新建项目一直在下载Gradle 下载的东西在“C:\Users\name\.gradle\wrapper\dists\gradle-*.*-all”,其 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int main(void){ int n; string s; string p = "wang"; while(cin >> s) { int cnt = 0; size_t found = s.find( 阅读全文
摘要:
#include<iostream> #include<stdio.h> #include<string.h> #include<math.h> using namespace std; int fact(int n,int p) //十进制转为任意进制 (n是十进制数,p是要转化进制选择) { i 阅读全文
摘要:
如输入:3 》》》二进制101 所以 输出 》》》2 #include<iostream> #include<string> using namespace std; void count_byte(unsigned int x) { unsigned int tmp = 1; int countx 阅读全文
摘要:
#include<iostream> using namespace std; void shiftone(string &s, int m) { while (m--) { char t = s[0]; int len = s.size(); for (int i = 1; i < len; ++ 阅读全文
摘要:
#include <stdio.h> #include <string.h> int main(){ char *token = "she"; FILE *fp = fopen("test.txt","a+"); char buf[1024]; char *p; int s=-1,len=strle 阅读全文
摘要:
int *(*testState) = new int*[n];for (int i = 0; i < n; ++i){ testState[i] = new int[w]; for (int j = 0; j < w; ++j) { testState[i][j] = 1; }} 阅读全文
摘要:
大概思路: 一个map<string,int>存储输入的字符内容以及输入的次数,对次数进行判断,输出少于指定次数的字符串: #include<iostream> #include<map> #include<string> using namespace std; int main() { int 阅读全文
摘要:
题目描述:给定一个长度为n的整数数组a,元素均不相同,问数组是否存在这样一个片段,只将该片段翻转就可以使整个数组升序排列。其中数组片段[l,r]表示序列a[l], a[l+1], ..., a[r]。原始数组为 a[1], a[2], ..., a[l-2], a[l-1], a[l], a[l+1 阅读全文
摘要:
约瑟夫问题是个有名的问题:N个人围成一圈,从第一个开始报数,第M个将被杀掉,最后剩下一个,其余人都将被杀掉。例如N=6,M=5,被杀掉的顺序是:5,4,6,2,3。最后只有1存活。 思路:用环链表实现,每计数到M,删除该处的节点,直到最后仅剩一个节点,输出节点的值,就是存活的人。 #include< 阅读全文