private int treeId
private String treeType// 树种类型
private int count//种植数量
public int getCount() {
return count
}
public void setCount(int count) {
this.count = count
}
public int getTreeId() {
return treeId
}
public void setTreeId(int treeId) {
this.treeId = treeId
}
public String getTreeType() {
return treeType
}
public void setTreeType(String treeType) {
this.treeType = treeType
}
}
public class Address {
private int addCode//地区编码
private String area//地名
public int getAddCode() {
return addCode
}
public void setAddCode(int addCode) {
this.addCode = addCode
}
public String getArea() {
return area
}
public void setArea(String area) {
this.area = area
}
}
import java.util.HashMap
import java.util.Map
public class People {
private int userId
private String username
private Map<String,Map<String,Integer>>map
/**
* 传入地区和树种,种树成功。保存到map中。
* @param address
* @param tree
*/
public void plantingTrees(String address,Tree tree){
Map map = new HashMap()
map.put(tree.getTreeType(),tree.getCount())
this.map.put(address,map)
}
public int getUserId() {
return userId
}
public void setUserId(int userId) {
this.userId = userId
}
public String getUsername() {
return username
}
public void setUsername(String username) {
this.username = username
}
public Map<String, Map<String, Integer>>getMap() {
return map
}
public void setMap(Map<String, Map<String, Integer>>map) {
this.map = map
}
}
#include <stdio.h>int main()
{
int n,m
int b[100]
int i,j
int s=0
int t
scanf("%d",&n)
for(i=0i<ni++,s=0)
{
scanf("%d",&m)
for(j=0j<mj++)
{
scanf("%d",&t)
s+=t
}
b[i]=s
}
s=0
for(i=0i<ni++)
{
printf("\n%d",b[i])
s+=b[i]
}
printf("\n\n%d",s)
return 0
}
望采纳,谢谢
程序本身是没问题的,但是可能是输出格式的问题,一般OJ题目都有严格的输入输出检测的。
题目的output中是:5[空格]3
#include <stdio.h>int main(void)
{
int m,n
scanf("%d%d",&m,&n)
printf("%d %d",m/n,m%n)
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)