标签:nbsp article mic pac sdn com printf 相同 php
额............我也不知道(先记下)
printf("%d\n", (scanf("%d", &n), n))
printf("%d\n", (~scanf("%d", &n)));
打印结果都相同........
测试题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1787
测试代码:
代码参考博客:https://blog.csdn.net/ydd97/article/details/47168351
#include <iostream> #include <vector> #include <cstdio> #define ll long long using namespace std; ll euler(ll n) { int ret = n; for (int i = 2; i * i <= n; i++) { if (n%i==0) { ret -= ret / i; while(n%i == 0) { n /= i; } } } if (n > 1) ret -= ret / n; return ret; } int main() { int n; // printf("%lld\n", (scanf("%d", &n), n)); // printf("%lld\n", (~scanf("%d", &n))); while(scanf("%d", &n), n) { // while(~scanf("%d", &n)) { printf("%d\n", n-euler(n)-1); } return 0; }
今天看到一篇博客:
他可能也是这样想的。然后就没有然后了
while(~scanf("%d", &n)) 和 while(scanf("%d", &n), n) 有啥不同
标签:nbsp article mic pac sdn com printf 相同 php
原文地址:https://www.cnblogs.com/hello-dummy/p/13349362.html