06 2012 档案
摘要:题目地址http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1435前面一个是大数需要字符串来存 后面一个定义long型就够了 计算的时候就是边做边把字符转换为数字取余比较简单一点 可以边转边取余 转完输出结果就行了除法 模拟手算 从头找 找第一个能被它整除的那一位 找到之后 就依次除就行了 除的结果存在一个整型数组里#include <stdio.h>#include <stdlib.h>#include&l
阅读全文
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=96&problem=1056&mosmsg=Submission+received+with+ID+10189080纠结了 两天的一道题 由于字符串函数没用对 就一直做不对 搜了下解题报告 终于知道该怎么用了。View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include<
阅读全文
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1819这个题找到规律就很好做,就是相当于二进制,o代表1,空格代表0,然后算出来为字母的ASCII码,输出就行了。View Code 1 #include <stdio.h> 2 #include <math.h> 3 #include<string.h> 4 int main() 5 { 6 int i,j,k;
阅读全文
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1756这个题错了十几次 runtime 占了10次 错了一天 最后终于改对了 用一个小数组把单词存起来 然后把这个单词复制给一个二维数组,复制的时候查找一下前面是否有重复的 如果没有就复制给它,然后用快排对所有的进行排序。View Code 1 #include <stdio.h> 2 #include<string.h> 3 #include<std
阅读全文
摘要:题目http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=585找一个字符串是否是另一个的前缀 ,我用了一个字符串函数,然后比较了下就行了View Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include<string.h> 4 int main() 5 { 6 int i,j,g,k,n,m,f = 0,q = 0,flag; 7 char
阅读全文