首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C++
#include<iostream>
#include<cstdlib>
#include<stdlib.h>
#include<time.h>
using namespace std;

int main()
{
srand((unsigned)time(NULL));
int a,c,d;
d = 0;
a = rand()%100;
......................
阅读全部 | JasonBi 贴于 2022年11月3日 22:26     hide bbsi
#include<iostream> 
using namespace std;
int main()
{
int i,j,k;
   for(i=1;i<=4;i++)
   {
    for(j=0;j<2*i-1;j++)
    cout<<"*";
    cout<<endl;
   }
   
......................
阅读全部 | 小黎同学 贴于 2022年10月30日 10:35     hide bbsi
#include <iostream>
using namespace std;
int main()
{
    int x,y;
    cin>>x;
    if(x>=10)
    {
        y=x-1;
        cout<<"y"<<y<<endl;
    }
    else if(1<x<10)
......................
阅读全部 | 小黎同学 贴于 2022年10月29日 16:11     hide bbsi
#include <iostream>
using namespace std;
int main()
{
    int x,y;
    cin>>x;
    if(x>=10)
    {
        y=x-1;
        cout<<"y"<<y<<endl;
    }
    else if(1<x<10)
......................
阅读全部 | 小黎同学 贴于 2022年10月29日 16:11     hide bbsi
# include <iostream>
using namespace std;
int main()
{
    int a,b,c,temp;
    cin>>a>>b>>c;
    if(a>b)
    {
        temp=a;
        a=b;
        b=temp;
    }
......................
阅读全部 | 小黎同学 贴于 2022年10月27日 11:48     hide bbsi
#include <iostream>
using namespace std;
int main ()
{
    double r,c;
    cout<<"输入圆的半径"<<endl;
    cin>>r;
    c=2*r*3.14;
    cout<<"圆的周长为"<<c<<endl;
    return 0;
}
阅读全部 | 小黎同学 贴于 2022年10月23日 16:21     hide bbsi
#include <iostream>
using namespace std;
int main()
{
    cout<<"*****"<<endl;
    cout<<"欢迎光临"<<endl;
    cout<<"*****"<<endl;
    return 0;
}
阅读全部 | 小黎同学 贴于 2022年10月23日 09:26     hide bbsi
#include <iostream>
using namespace std;
int main()
{
    cout<<"*****"<<endl;
    cout<<"欢迎光临"<<endl;
    cout<<"*****"<<endl;
    return 0;
}
阅读全部 | 小黎同学 贴于 2022年10月23日 09:26     hide bbsi
/**
 * 【程序18】
 * 题目:求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。例如2+22+222+2222+22222(此时
 *       共有5个数相加),几个数相加有键盘控制。
 * 程序分析:关键是计算出每一项的值。
 */

#include<bits/stdc++.h>
using namespace std;
int a,n,sum=0,ma;
int jf(int i){
    int m=0,f=0;
......................
阅读全部 | wszmsz 贴于 2022年10月14日 16:33     hide bbsi
/**
 * 【程序12】
 * 题目:判断101-200之间有多少个素数,并输出所有素数。
 * 程序分析:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除,
 *           则表明此数不是素数,反之是素数。
 */

#include<iostream>
using namespace std;
bool is_prime(int i){
    int j=2;
    while(j<i){
......................
阅读全部 | wszmsz 贴于 2022年10月14日 16:23     hide bbsi
上一页 1 2 3 4 5 6 7 8 9 10 下一页