acmore|acmore.cc111211132000年秋浙江省计算机等级考试二级C 编程题
2018-02-28 13:04
381 查看
(1):
import java.util.Scanner;
public class Main
{
public static void main(String[]args)
{
Scanner sca=new Scanner(System.in);
int n=sca.nextInt();
int[]list=new int
;
for (int i=0;i<n;i++)
{
list[i]=sca.nextInt();
}
int x=0;
for (int j=0;j<n;j++)
{
if (list[j]%2==0)
{
x=x+list[j];
}
}
System.out.print(x);
}
}
(2):
import java.util.Scanner;
public class Main
{
public static void main(String[]args)
{
Scanner sca=new Scanner(System.in);
String x=sca.nextLine();
String y=sca.nextLine();
print(x,y);
}
public static void print(String x,String y)
{
for (int i=0;i<y.length();i++)
{
if (y.charAt(i)!=x.charAt(0))
{
System.out.print(y.charAt(i));
}
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[]args)
{
Scanner sca=new Scanner(System.in);
int n=sca.nextInt();
int[]list=new int
;
for (int i=0;i<n;i++)
{
list[i]=sca.nextInt();
}
int x=0;
for (int j=0;j<n;j++)
{
if (list[j]%2==0)
{
x=x+list[j];
}
}
System.out.print(x);
}
}
(2):
import java.util.Scanner;
public class Main
{
public static void main(String[]args)
{
Scanner sca=new Scanner(System.in);
String x=sca.nextLine();
String y=sca.nextLine();
print(x,y);
}
public static void print(String x,String y)
{
for (int i=0;i<y.length();i++)
{
if (y.charAt(i)!=x.charAt(0))
{
System.out.print(y.charAt(i));
}
}
}
}
相关文章推荐
- acmore|acmore.cc111010111999年秋浙江省计算机等级考试二级C 编程题
- acmore|acmore.cc11141115 2001年秋浙江省计算机等级考试二级C 编程题
- acmore|acmore.cc11161117 2002年秋浙江省计算机等级考试二级C 编程题
- acmore|acmore.cc11181119 2003年秋浙江省计算机等级考试二级C 编程题
- 全国计算机等级二级C++第四章习题编程题6 :编写一个函数 char *strfind(char *s, char *t),用于查找字符串t在字符串s中最右边出现的位置,如果没有找到则返回NULL.
- acmore|acmore.cc1083级数求和1084选数1086过河卒(NOIP2002)
- 计算机等级考试二级C++上机模拟试题11套汇总及答案解释(三)
- 2007年9全国计算机等级考试二级笔试试卷C++语言程序设计答案及解析
- 全国计算机等级考试二级Java笔试基础答案
- 湖南省计算机等级考试(二级)题库 第二部分
- acmore|acmore.cc1087乒乓球1088数字游戏1089栈1090麦森数(NOIP2003)
- 2006年4月全国计算机等级考试二级笔试试卷C语言程序设计
- 湖南省计算机等级考试(二级)题库 第三部分
- 2008年9月计算机等级考试二级C++笔试试题答案与解析
- 2005年4月全国计算机等级考试二级笔试试卷
- 2006年4月计算机等级考试二级Java笔试答案
- 全国计算机等级考试二级教程--C语言程序设计(2018年版) 随手笔记(四)
- 2008年9月计算机等级考试二级Java笔试试题及答案
- 湖南省计算机等级考试(二级)题库 第四部分
- 计算机等级考试二级ACCESS考试大纲