string
gandyLyn
Keep walking
展开
-
洛谷 1038 统计单词数
#include <iostream> #include <cstring> using namespace std; int main() { int temp,ori,num,i; //temp用来保存临时起点,ori表示第一个单词首字母下标 char str[1000001] ,word[11]; temp=ori=-1; num=i=0; //...原创 2019-10-14 12:34:12 · 53 阅读 · 0 评论 -
洛谷 1482 Cantor表
题目描述 现代数学的著名证明之一是Georg Cantor证明了有理数是可枚举的。他是用下面这一张表来证明这一命题的: 1/1 1/2 1/3 1/4 1/5 … 2/1 2/2 2/3 2/4 … 3/1 3/2 3/3 … 4/1 4/2 … 5/1 … … 这次与NOIp1999第一题不同的是:这次需输入两个分数(不一定是最简分数),算出这两个分数的积(注意该约分的要约分)后输...原创 2019-10-14 12:25:26 · 39 阅读 · 0 评论 -
洛谷 2084 二至九进制转化为十进制
题目描述 进制转换,比如(10101)2 ,十进制表示的式子: 1*2^4+0*2^3+1*2^2+0*2^1+1*2^0, 那么请你编程实现,将一个M进制的数N转换成十进制表示的式子。 注意:当系数为0时,该单项式要省略。 输入格式 两个数,M和N,中间用空格隔开。 输出格式 共一行,一个十进制表示的式子。 输入输出样例 输入 2 10101 输出 1*2^4...原创 2019-10-14 12:04:33 · 51 阅读 · 0 评论 -
杭电1002 大数相加
Problem Description Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T(1<=T<=20) ,which means the number of tes...原创 2019-10-14 10:16:13 · 30 阅读 · 0 评论 -
leetcode 14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: ["flower","flow","flight"] Output: ...原创 2019-09-30 10:41:15 · 30 阅读 · 0 评论