<c:if>条件判断 和 取值做乘法运算

本文介绍了JSTL标签库中核心标签的使用方法,包括条件判断和变量设置等基本操作。通过实例展示了如何根据不同的状态显示文本,并计算乘积。

http://www.yiibai.com/jstl/jstl_core_if_tag.html

 

<td>&nbsp;${log.etdhHandleTime }<span>&nbsp;
<c:if test="${log.etdhHandleStatus == 20 }">
<p><c:out value="创建"></c:out></p>
</c:if>
<c:if test="${log.etdhHandleStatus == 25 }">
<c:out value="下发"></c:out>
</c:if>

 

 


<c:set var="amount" value="${item.ethmQuantity }"/>
<c:set var="price" value="${item.ethmPrice }"/>
<td>
<c:set var="sum" value="${amount*price}"/>
<c:out value="${sum}"/>
</td>

转载于:https://www.cnblogs.com/21heshang/p/5949880.html

#include <iostream> #include <iomanip> #include <fstream> #include <cmath> #include <numeric> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <string> #include <cstring> #include <utility> #include <bitset> #include <climits> #include <cstdlib> #include <chrono> #include <functional> using namespace std; #define endl '\n' #define ll long long #define IOS ios::sync_with_stdio(false);cin.tie(nullptr); typedef pair<int, int> PII; typedef pair<int, PII> PIII; typedef unsigned long long ull; const int N = 2e5 + 10; const int MOD = 1e9 + 7; const int INF = INT_MAX; const ll LNF = LLONG_MAX; const double PI = acos(-1); const int dx4[] = {-1, 0, 1, 0}; const int dy4[] = {0, 1, 0, -1}; const int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1}; const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1}; bool good(ll num) { string s = to_string(num); bool c1 = 0, c2 = 0, c3 = 0; for(char c : s) { if(c == '1') c1 = 1; else if(c == '2') c2 = 1; else if(c == '3') c3 = 1; else return 0; } if(!c1 || !c2 || !c3) return 0; for(int i = 1; i < s.length(); i ++ ) { if(s[i] == s[i - 1]) return 0; } return 1; } vector<ll> qs(int n) { vector<ll> arr; ll s = 1; for(int i = 1; i < n; i ++ ) s *= 10; ll t = s * 10; for(ll i = s; i < t; i ++ ) arr.push_back(i); return arr; } void solve(int n) { vector<ll> arr = qs(n); for(ll a : arr) { for(ll b : arr) { ll p = a * b; if(good(p)) { cout << a << " " << b << endl; return; } } } cout << -1 << endl; } int main() { IOS; int n; cin >> n; solve(n); return 0; } n最大可以达到2E5 让 运行时候内存不能超过256MB 且运行时间不超过一秒 请修改
最新发布
10-20
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值