目录
剪花布条
客似云来
剪花布条
#include <iostream>
#include <string>
using namespace std;
int main() {
string s,t;
while(cin>>s>>t)
{
int ans = 0;
while(s.find(t) != string::npos)
{
s.erase(s.find(t), t.size());
ans++;
}
cout<<ans<<endl;
}
}
客似云来
#include <iostream>
#include <vector>
using namespace std;
int main() {
int from, to;
vector<long long> arr(80);
arr[0] = 1, arr[1] = 1;
for (int i = 2; i < arr.size(); i++)
{
arr[i] = arr[i - 1] + arr[i - 2];
}
while (cin >> from >> to)
{
long long ans = 0;
for (int i = from - 1; i < to; i++)
{
ans += arr[i];
}
cout << ans<<endl;
}
return 0;
}