Coderforces Bit++
2017-06-13 08:27
246 查看
http://codeforces.com/problemset/problem/282/A
import java.util.Scanner;
public class Bit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int temp = 0;
for(int i = 0; i <n; i++) {
String string = scanner.next();
if(string.startsWith("+") || string.endsWith("+")) temp++;
else temp--;
}
System.out.println(temp);
}
}
import java.util.Scanner;
public class Bit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int temp = 0;
for(int i = 0; i <n; i++) {
String string = scanner.next();
if(string.startsWith("+") || string.endsWith("+")) temp++;
else temp--;
}
System.out.println(temp);
}
}
相关文章推荐
- 文章标题 coderforces 339D : Xenia and Bit Operations (线段树+点修改)
- 文章标题 coderforces 514D : R2D2 and Droid Army (二分+RMQ预处理)
- coderforces-#428三道水题
- CoderForces #282 Dic2 D--Obsessive String
- New Year Transportation(CoderForces A)
- 文章标题 CoderForces 1B : Spreadsheets(模拟)
- coderforces--418 div2 C. An impassioned circulation of affection
- Coderforces String Task
- Coderforces Nearly Lucky Number
- codforces 282 A Bit++(模拟水题)
- Coderforces 20C 最短路记录路径
- coderforces 508A 易错
- Coderforces 509B
- coderforces 702A Maximum Increase
- 【CoderForces】#296 Div2 C(线段树+set)
- Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)
- Coderforces Domino piling
- coderforces 846D Monitor
- Coderforces 508B 简单贪心
- Coderforces 730H 730G