Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
125699 | 梁乃元 | 火柴棒等式 | C++ | 解答错误 | 20 | 0 MS | 240 KB | 452 | 2024-01-23 21:23:54 |
# include <bits/stdc++.h> using namespace std ; int nums [10] = { 6 , 2 , 5 , 5 , 4 , 5 , 6 , 3 , 7 , 6 } ; int main ( ) { int n , cnt = 0 ; cin >> n ; n -= 4 ; for ( int i = 0 ; i <= 9 ; i ++ ) { for ( int j = 0 ; j <= 9 ; j ++ ) { if ( nums [i] + nums [j] + nums [i + j] == n && i + j < 10 ) { cnt ++ ; // cout << i << " + " << j << " = " << i + j << endl ; } } } cout << cnt << endl ; return 0 ; }