欧拉公式:
F(面数)+V(顶点数)-E(楞数)=2
#include <iostream> using namespace std; int main() { long long n,m; while(cin >> n >> m){ if(n == 0&& m == 0) break; long long ans = 0; ans = n + (m-2); cout << ans << endl; } return 0; }
时间: 2024-11-09 21:14:13
欧拉公式:
F(面数)+V(顶点数)-E(楞数)=2
#include <iostream> using namespace std; int main() { long long n,m; while(cin >> n >> m){ if(n == 0&& m == 0) break; long long ans = 0; ans = n + (m-2); cout << ans << endl; } return 0; }