摘要:
//请统计某个给定范围[l,r]的所有整数中,数字2出现的次数 //比如给定范围[2,22],数字2在数2中出现了一次,12中出现一次,20中出现一次,21中出现一次,22中出现2次,所以结果应为6 #include <bits/stdc++.h> using namespace std; int 阅读全文
摘要:
//第一种解法,单for,关键是t*=i这行 # include <bits/stdc++.h>using namespace std;int main(){ int n; double e,s; e=1.0; s=0.0; long long t=1; scanf("%d",&n); for(in 阅读全文
摘要:
# include <bits/stdc++.h>using namespace std;////第一种解法,用一层for循环 //int main()//{// int n;// scanf("%d",&n);// long long s=0,t=1;// for(int i=1;i<=n;i++ 阅读全文