首页 > 其他分享 >5.23

5.23

时间:2023-05-23 23:33:17浏览次数:28  
标签:right return cout sentence int 5.23 left

              }

       }

       return count;

}

int main()

{

       string sentence;

       cout<<"请输入一条英文语句:";

       getline(cin,sentence);

       int letter_count = count_letters(sentence);

       cout<<"这条英文中字母的个数为:"<<letter_count<<endl;

       return 0;

}

6-22

void reverse(string &s)

{

       int left = 0,right = s.length() - 1;

       while(left<right)

       {

              swap(s[left],s[right]);

              left++;

              right--;

        }

}

6-23

#include<iostream>

#define N 8

using namespace std;

int main()

{

       int a[N];

       int b=0;

       cout<<"请输入N个人的考试成绩"<<endl;

       for(int i=0;i<N;i++)

       {

              cin>>a[i];

              b+=a[i];

       }

       double c=b/8.000;

       cout<<"这些同学的平均成绩为:"<<c<<endl;

       return 0;

}

标签:right,return,cout,sentence,int,5.23,left
From: https://www.cnblogs.com/lml66/p/17426772.html

相关文章

  • 5.23
      程序流程图: 代码:#include<bits/stdc++.h>usingnamespacestd;main(){longn,sum,i;while(scanf("%ld",&n)!=EOF){printf("ÔÚ1-%ldÖ®¼äµÄ½×ÌÝÊýΪ£º\n",n);sum=0;for(i=7;i<=n;i++)......
  • 每日总结-23.5.23
    <%@pageimport="san.Thesql"%><%@pageimport="san.Pd_stu"%><%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><!DOCTYPEhtmlPUBLIC......
  • 2023.5.23
     1#include<iostream>2#include<iomanip>3usingnamespacestd;4floatPI=3.14159f;5classShape6{7public:8virtualfloatgetArea()=0;9};10classCircle:publicShape11{12public:13floatr;14float......
  • 5.23
    #include<iostream>#include<cmath>usingnamespacestd;classPoint{private:doublex;doubley;doublez;public:Point(doublea,doubleb,doublec):x(a),y(b),z(c){};frienddoubleoperator-(Point,Point);};template<class......
  • day77(2023.5.23)
    1.JSP简介 2.JSP运行原理 3.JSP标签的使用运行结果: 4.JSP原始标签的使用 运行结果:5.JSP的指令标签6.JSP的内置对象 7.请求转发 8.请求转发案例 运行结果: 9.JSP中的四大作用域对象 10.JS......
  • 5.23每日总结
    今天学习了如何实现AndroidApp的自动登录,目前遇到了点困难,只能实现记住账户和密码不用用户再次输入的功能,还没有实现登录一次后点击应用直接进入。  ......
  • 5.23每日总结
    今天学习了如何将数据库挂到网端,具体步骤如下:在云端搭建数据库服务器搭建云端数据库服务器可以使用云服务商的数据库服务,例如:AWSRDS、阿里云RDS等。根据实际情况选择一个适合的云数据库供应商,并创建一个新的数据库实例。然后通过数据库供应商提供的远程连接工具或命令行工具,......
  • 2023.5.23编程一小时打卡
    一、问题描述:定义抽象基类Shape,由它派生出五个派生类:Circle(圆形)、Square(正方形)、Rectangle(长方形)、Trapezoid(梯形)和Triangle(三角形),用虚函数分别计算各种图形的面积,输出它们的面积和。要求用基类指针数组,每一个数组元素指向一个派生类的对象。PI=3.14159f,单精度浮点数计算。输......
  • 2023.5.23每日总结
    <%@pageimport="wangzhan.Thesql"%><%@pageimport="wangzhan.Pd_P_assignment"%><%@pageimport="wangzhan.Pd_S_assignment"%><%@pagelanguage="java"contentType="text/html;charset=UTF......
  • 5.23
    #include<stdio.h>voidmain(){intinteger,i,max,min,sum;max=-32768;min=32767;sum=0;for(i=0;i<10;i++){printf("Inputnumber%d:",i);scanf("%d",&integer);sum+=integer;if(integer>max)max=integer;if(integer<min)min=intege......