[java]代码库
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int sum = 0;
for( int i = 0; i < num; i++)
{
int n = scan.nextInt();
int w = scan.nextInt();
sum += w;
}
System.out.println(sum);
scan.close();
}
}
interface CalInterface
{
int getweight();
}
class TV implements CalInterface
{
int weight;
public TV (int a)
{
weight = a;
}
public int getweight()
{
return weight;
}
}
class WashMachine implements CalInterface
{
int weight;
public WashMachine (int a)
{
weight = a;
}
public int getweight()
{
return weight;
}
}
class Airconditioner implements CalInterface
{
int weight;
public Airconditioner (int a)
{
weight = a;
}
public int getweight()
{
return weight;
}
}
class Truck
{
}