随笔分类 - 上机
摘要:从文件中读取一行字符,对字符按逗号分割成单词,并计算每个单词出现次数 #include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct word{ char str[32]; int cot; }word; void mai
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> char a[1024][1024]; int count=0; void split(char s[],char del){ int len=strlen(s); int i=0,k=0
阅读全文
摘要:#include <stdlib.h> #include <string.h> #include <iostream> #include <math.h> #include <vector> using namespace std; const int inf=999999;//0x7fffff v
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; int main(){ int n; cin>>n; for(int i=2;i<=n;i++){ while(n!=0){ if(n%i==
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; int greatest_common_divisor1(int a,int b){ //辗转相减法 while(a!=b){ if(a>b)
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; void k_system(int n,int k){ //n:十进制数,k为进制 int t=n; int m=0; int a[10];
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool hui_number(int n){ int t=n; int k=0; int a[10]; while(t>0){ //提前数的
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool Narcissistic_number(int n){ int t=n; int a[3]; int k=0; while(t>0)
阅读全文
摘要:用一维数组或二维数组打印杨辉三角 #include <stdlib.h> #include <math.h> #include <iostream> using namespace std; int a[15][15]; int aa[1024]; void yang_2D(){//二维数组打印杨辉
阅读全文
摘要:#include <stdlib.h> #include <math.h> #include <iostream> using namespace std; bool prime(int x){ for(int i=2;i*i<=x;i++){ if(x%i==0) return false; }
阅读全文

浙公网安备 33010602011771号