摘要: 地址:http://hustoj.sinaapp.com/problem.php?id=1817一开始理解错题意,纠结好半天也不难,用最笨的办法,循环嵌套,一遍遍比对得出答案 1 #include <stdio.h> 2 #include <string.h> 3 4 char name[10][15]; 5 int gift[10][2],result[10]; 6 int n;//人数 7 8 int main() 9 {10 int i=0,j=0,k=0,l=0;11 char in[15];12 scanf("%d",&n);13 阅读全文
posted @ 2013-01-15 00:38 tjsuhst 阅读(402) 评论(0) 推荐(0)
摘要: 从简单的开始地址:http://hustoj.sinaapp.com/problem.php?id=1816很简单,模拟题,注意一下范围即可,不过千万不能用fflush(stdin),要不然报错,这个可能和OJ本身有关 1 #include <stdio.h> 2 3 int main() 4 { 5 char in; 6 long long star=1; 7 long long group=1; 8 in=getchar(); 9 while(in>='A' && in<='Z')10 {11 star=star*(i 阅读全文
posted @ 2013-01-14 23:29 tjsuhst 阅读(280) 评论(0) 推荐(0)
摘要: 题目:http://www.leapoahead.com/acm/problem.php?cid=1002&pid=3就是今天正式赛的题目思路:由所给排列生成接下来的排列中第m个排列,考虑18!很大,多以都用了64位储存网上查阅了相关知识,知道了大概生成思路,然后写出来最开始还进入了几次死循环 1 #include<stdio.h> 2 __int64 n,m,a[10000]; 3 4 void swap(__int64 * x,__int64 * y)//要求传入的是全局变量 5 { 6 __int64 t; 7 t=*x; 8 *x=*y; 9 *y=t... 阅读全文
posted @ 2012-12-31 03:05 tjsuhst 阅读(349) 评论(0) 推荐(0)