a,b,c=eval(input()) if a<=b: if b<=c: print(f"{a},{b},{c}") else: if a<=c: print(f"{a},{b},{c}") else: print(f"{a},{b},{c}") else: if a<=c: print(f"{a},{b},{c}") else: if b<=c: print(f"{a},{b},{c}") else: print(f"{a},{b},{c}")哪里有问题
时间: 2024-01-23 20:04:25 浏览: 28
这段代码存在语法错误,应该是缺少了一个语句块的结束符号" } "。同时,代码的缩进也有问题。正确的代码应该是这样的:
```python
a, b, c = eval(input())
authorEditText.getText().toString();
String publisher = publisherEditText.getText().toString();
book.setName(name);
book.setAuthor(author);
book.setPublisher(publisher);
bookDAO.update(book);
loadBooks();
}
});
builder.setNegativeButton("取消", null);
builder.show();
}
private void showDeleteDialog(final int id) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("删除图书");
builder.setMessage("确定要删除这本图书吗?");
builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
bookDAO.delete(id);
loadBooks();
}
});
builder.setNegativeButton("取消", null);
builder.show();
}
}
```
在上面的代码中,我们使用了 RecyclerView 来显示图书列表,使用了 AlertDialog 来显示添加、编辑和删除图书对话框。同时,我们还创建了一个 BookAdapter 类来将 Book 对象显示到 RecyclerView 上。在 BookActivity 中,我们调用 BookDAO 类的方法来对数据库进行增删改查操作,然后通过 BookAdapter 将数据显示到 RecyclerView 上。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)