随笔分类 - ACM_pku
摘要:banana band bee absolute acm ba b band abc#includeusing namespace std;//数据结构struct Treenode{ int count; Treenode *next[26]; Treenode(){ count=1; for(int i=0;inext[branch]) location->next[branch]->count++; else loca...
阅读全文
摘要:题意: 求一个实数R的n次幂 即ans = R ^ n;方法: 模拟高精度乘法两个大数相乘,以字符串输入,用数组a[], b[]按位存储,最终结果用另外一个数组c[]存储核心代码:memset(c, 0, sizeof(c)); //初始化结果数组for(i = 0; i < l1; i++) for(j = 0; j < l2; j++) { c[i + j] += a[i] * b[j]; c[i + j + 1] += c[i + j] / 10; c[i + j] %= 10; }此题方法,将...
阅读全文
摘要:// C++写法#include<iostream>using namespace std;int main(){ int a,b; cin>>a>>b; cout<<a+b<<endl; return 0;}// C写法#include<stdio.h>int main(){ int a,b; scanf("%d %d",&a, &b); printf("%d\n",a+b); return 0;}
阅读全文