首页 > 其他分享 >4.27

4.27

时间:2023-04-27 23:24:44浏览次数:32  
标签:10 cout int other static 4.27

#include<iostream>

using namespace std;

int i = 1;

void other() {

    static int a = 2;

    static int b;

    int c = 10;

    a += 2;

    i += 32;

    c += 5;

    cout << "---OTHER---" << endl;

    cout << "i:" << i << "a:" << a << "b:" << b << "c:" << c << endl;

    b = a;

}

int main() {

    static int a;

    int b = -10;

    int c = 0;

    cout << "---MAIN---" << endl;

    cout << "i:" << i << "a:" << a << "b:" << b << "c:" << c << endl;

    c += 8;

    other();

    cout << "---MAIN---" << endl;

    cout << "i:" << i << "a:" << a << "b:" << b << "c:" << c << endl;

    i += 10;

    other();

    return 0;

}

标签:10,cout,int,other,static,4.27
From: https://www.cnblogs.com/lml66/p/17360509.html

相关文章

  • 2023.4.27
    1//实验六任务22//定义猫科动物Animal类,由其派生出猫类(Cat)和豹类(Leopard),3//在Animal类中定义虚函数,输出“MynameisAnimal”,在派生类中4//分别重新定义该函数,显示“Mynameis**”,其中**为各自类名5#include<iostream>6#include<string>7usingnamespa......
  • 4.27
    问题描述:    小明有五本新书,要接给A、B、C这三位小朋友,若每人每次只能借一本,则可以有多少不同种的接法?设计思路1.根据题意,这五本数每个人都可借阅;2.则当第一个人挑选时可以有五种不同的选择,第二个人时有四种,最后一个人有三种;3.利用三次循环嵌套,对第一个人进行五次循......
  • 4.27
    1#include<iostream>2usingnamespacestd;3classRectangle{4public:5intj;6voidarea(intX=0,intY=0,intA=0,intB=0);7private:8intx,y,a,b;9};10voidRectangle::area(intX,intY,intA,intB){......
  • 4.27趣味百题4.4
    一问题描述 二设计思路最终分解为一个分子为1的分数可以用while循环执行根据埃及分数的特性对其不断分裂三流程图 四代码实现#include<iostream>usingnamespacestd;intmain(){inta=0,b=0,c=0;cout<<"请输入一个真分数先输入分子后输入分母"<<endl;cin>>a>>......
  • 4.27打卡
     #include<bits/stdc++.h>usingnamespacestd;classTime{private:intminute;inthour;public:voidset(inth,intm){minute=m;hour=h;}friendintoperator-(Time,Time);};intoperator-(......
  • 2023.4.27
     1//实验六任务22#include<iostream>3#include<string>4usingnamespacestd;5classPeople6{7public:8People(){}9~People(){}10voidsetValue(intm,stringstr)11{12age=m;13name=str;......
  • 2023.4.27编程一小时打卡
    一、问题描述:建立一个向量容器的实例s,不断对s调用push_back向其中增加新的元素,观察在此过程中s.capacity()的变化。二、解题思路:首先,编写一个向量容器vector<int>s,利用循环对其进行不断调用push_back,再输出它的capacity()函数观察它向量容器的容量的变化。三、代码实现:1#in......
  • 4.27
    #include<stdio.h>voidprint(ints[]);intjudge(intc[]);intj=0;main(){intsweet[10]={10,2,8,22,16,4,10,6,14,20};inti,t[10],l;printf("child12345678910\n");printf("......................\n");printf("tim......
  • 2023.4.27
    //Parent.vue<template>   <childv-model="value"></child></template><script>exportdefault{   data(){       return{           value:1       }   }}//Child.vue<template>   <input:value="value&......
  • 4.27 1.9
    一、问题描述N个有序整数数列已放在一堆数组中,利用二分法查找整数m在数组中的位置。若找到,输出其值,反之,输出“Notbefound!”。二、分析N个有序数应存放在数组中,根据数组下标的取值范围知指针low和high的初值分别为0N-1。除了三个指针变量low、high、mid之外还需要一个变......