一系列的入门and一堆吐槽

今天,就在我刚才刚刚发表一篇文章,里面有一句话

“反正没人看我博客我也不管啦什么都往上搬,大概没人会打我hhhh”

然后因为一些奇葩且无脑且可怕的原因,我的队友们若干秒后居然搜到了我的博客???

excuse me???

打脸现场啪啪啪(误)

所以现在开始说话要正常一点。咳咳,没错,至少要高冷且内向一些(端庄)

这篇文章是用来整理最近我的c++编写代码,都是一些基础题(嘲讽我你就完蛋了,小心我举报你)

我只是为了告诉学弟学妹们,学习c++也是需要恒心和毅力的(一本正经胡说八道),如果学姐以后的日子里再也没有更新过,你也不要失望,因为我可能只是去潜心学习(个鬼啊)了。

以下题目全部出自洛谷(可以选择跳过的说)

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
    int a;
    scanf("%d",&a);
    float sum=0;
    if (a<=150) sum=a*0.4463;
     else if (a<=400) sum=150*0.4463+(a-150)*0.4663;
      else sum=150*0.4463+250*0.4663+(a-400)*0.5663;
    printf("%.1f",sum);
}
小玉家的电费
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{ 
  int p=0,most=8;
  for (int i=1;i<=7;i++)
  {
      int a,b;
      scanf("%d%d",&a,&b);
      int c=a+b;
      if (c>most)
    {
        most=c; p=i;
    }
  }
  printf("%d",p);
  
  return 0;
}
不高兴的津津
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
using namespace std;
int main()
{
    int x,y=0,extra=0;
    for (int i=1;i<=12;i++)
    {
        scanf("%d",&x);
        extra=extra+300-x;
        if (extra<0) 
        {
            printf("-%d",i);
            return 0;
        }
        y=y+extra/100;
        extra=extra% 100;
    }
    printf("%d",extra+y*120);
    return 0;
}
津津的储蓄计划
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
    int k;
    scanf("%d",&k);
    double Sn=0;
    int i=1;
    while (Sn<=k) 
     {
         Sn=Sn+1/(float)i;
         i++;
     } 
    printf("%d",i-1);
}
级数求和

 

 

 

感谢过程中帮助过我的lhq同学,此致敬礼(划去)

 

祝大家六一节快乐(没错我还是个儿童,不许反驳),怀念小学的游园活动了。

2017-06-01  Hathaway

posted @ 2017-06-01 15:54  Hathawaxy  阅读(209)  评论(0编辑  收藏  举报