- 博客(13)
- 收藏
- 关注
原创 数根
#include<stdio.h>int main(){ int arr[100]; int i,j; for( i=0;;i++){ scanf("%d",&arr[i]); if(arr[i]==0){ break; } } for( j=0;arr[j]!=0;j++){
2017-03-27 20:23:35 267
原创 最大公约数与最小公倍数的探究
//求两个数最大公约数#include<stdio.h>int main(){ int a,b; int t; while(1){ scanf("%d %d",&a,&b); if(a==0&&b==0){ break; }else{ t=a%b; wh
2017-03-27 20:04:37 298
原创 AOJ鸡兔同笼
#include <stdio.h>int main(){ int a,b; int m,n; while(1){ scanf("%d %d",&a,&b); if(a==0&&b==0){ break ;}else if(a<=0||b<=0||a*2>b||(b-a*2)%2!=0||(a-((b-2*a)/2))<0){ print
2017-03-23 19:38:06 235
原创 AOJ第九届程序设计竞赛初赛
#include<stdio.h>int main() { int n; int i, j; scanf("%d", &n); int arr[n]; for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } for (j = 0; j < n; j++) { int
2017-03-22 19:33:02 309
原创 AOJ759会绕圈的数
#include<stdio.h>int main(){ int i; int n; int arr[100]; for(i=0;;i++){ scanf("%d",&arr[i]); if(arr[i]==0){ break; } } for(i=0;arr[i]!=0;i++
2017-03-18 17:13:42 394
原创 AOJ800开关灯问题
import java.util.*;public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int N=sc.nextInt(); int[] arr=new int[N]; for(int i
2017-03-15 20:32:27 840
原创 AOJ803魔方
package contest;import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ int a=sc.
2017-03-15 19:29:51 243
原创 ACM判断三角形(多组输入)
package contest;import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int m=sc.nextInt(); int[] arra=new in
2017-03-14 19:07:59 933
原创 A+B(EOF)
import java.io.*;import java.util.*;public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(sc.hasNextInt()){ System.out.pr
2017-03-12 20:40:35 251
转载 A+B
A+B问题应该可以说是做起来最开心的ACM题目了,杭电上从1089~1096全都是A+B问题,虽然都是水题,但是在此处也贴出来算了,八道题随便贴几道,内容没什么好说的,就加加加~~~就行啦。 因为题目比较简单,我今天又正好学完了Java第一季的课程,所以就尝试着用Java语言来提交这几道题,当然也遇到了第一次提交编译错误的问题,又在网上查了一下才知道用Java做ACM题是有些规定的。具体的因为我
2017-03-11 20:10:42 270
原创 trapping_rain_water
package Week1_DP;public class trapping_rain_water { /** * @param args */ public static void main(String[] args) { int[] arr={3,0,0,0,0,3}; int s=method(arr); Sy
2017-03-07 18:57:00 239
原创 lintcode77最长公共子序列(动态规划medium)
public class Solution { /** * @param A, B: Two strings. * @return: The length of longest common subsequence of A and B. */ public int longestCommonSubsequence(String A, String B)
2017-03-05 16:09:36 267
原创 lintcode394硬币排成线(动态规划medium)
public class Solution { /** * @param n: an integer * @return: a boolean which equals to true if the first player will win */ public boolean firstWillWin(int n) { if(n%3==
2017-03-01 20:03:00 664
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人