#include<cstdio>
#include<cstdlib>
int main()
{ int n;
char c;
printf("请输入你的姓名(拼音)\n");
scanf("%s",&c);
printf("祝你生日快乐!\n");
system("pause");
return 0;
}
很简单的!!
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
const int inf=0xfffffff ;
int preminv[21] ;
int ri[21],hi[21] ;
int total,floornum ;
int ans ;
int dfs (int n,int v,int s,int maxr,int maxh)
{
int res ;
int i,tmpr,tmph,tmpsum ;
if (n>floornum){
if (v==total && s+ri[1]ri[1]<ans){
ans = s+ri[1]ri[1] ;
return 1 ;
}
}
for (ri[n]=maxr-1 ; ri[n]>=floornum-n+1 ; ri[n]--){
res = 20(total-v)/ri[n] + ri[1]ri[1] ;
if (res + s >= ans) continue ;
for (hi[n]=maxh-1 ; hi[n]>=floornum-n+1 ; hi[n]--){
if (v+ri[n]ri[n]hi[n]+preminv[floornum-n]>total) continue ;
tmpr = ri[n] ,tmph = hi[n],tmpsum = 0 ;
for (i=n ; i<=floornum ; i++){
tmpsum += tmprtmprtmph ;
tmpr-- , tmph-- ;
}
if (v+tmpsum<total) continue ;
dfs(n+1,v+ri[n]ri[n]hi[n],s+2ri[n]hi[n],ri[n],hi[n]) ;
}
}
return 1 ;
}
int main()
{
int tmpv,tmpr,tmph ;
int i ;
tmpv=0 ;
for (i=1 ; i<21 ; i++){
tmpv += iii ;
preminv[i] = tmpv ;
}
while (scanf("%d%d",&total,&floornum)!=EOF){
ans = inf ;
tmpv = total - preminv[floornum-1] ;
if (tmpv>0){
tmpr = sqrt (10tmpv/floornum) + 1 ;
tmph = 10tmpv/(floornumfloornum) + 1 ;
dfs(1,0,0,tmpr,tmph) ;
}
if (ans==inf){
ans = 0 ;
}
printf("%d\n",ans) ;
}
return 0;
}
#include<stdioh>
main()
{ int low,high,mid,n;
while(1){
mid=15;low=0;high=31;
printf("你的生日比%d号大还是小?大输入1,小输入2,等于3\n",mid);
scanf("%d",&n);
while(n!=3){
if(n==1)low=mid+1;
if(n==2)high=mid-1;
mid=(low+high)/2;
printf("你的生日比%d号大还是小?大输入1,小输入2,等于3\n",mid);
scanf("%d",&n);
}
printf("你的生日是%d号\n",mid);
}
}
如图所示,望采纳。。。。。。
#include"stdio.h"
#include <stringh>
intmain(void){
chara[]="Iwishyouahappybirthday!baiIwishyouahappybirthday!",m[4],i;
printf("\n\n\n");
printf("%*.*s\n",58,21,"_*=__=*_");
printf("%*.*s\n",61,25,"Wishyourbirthday!");
printf("%*.*s\n",63,29,"Iwishyouahappybirthday!");
printf("%*.*s\n",65,33,a);
printf("%*.*s\n",66,35,a);
printf("%*.*s\n",66,35,a);
printf("%*.*s\n",65,33,a);
printf("%*.*s\n",64,31,a);
printf("%*.*s\n",63,29,a);
printf("%*.*s\n",61,25,a);
printf("%*.*s\n",59,21,a);
printf("%*.*s\n",57,17,a);
printf("%*.*s\n",55,13,a);
printf("%*.*s\n",53,9,a);
printf("%*.*s\n",51,5,a);
printf("%*.*s\n",50,3,a);
printf("%*.*s\n",49,1,a);
return0;
}
扩展资料或者:
#include <stdioh>
#include <mathh>
#include <stdlibh>
#defineI20
#defineR340
intmain()
{
system("modeconcols=80lines=60");
system("title向你致以最诚挚的祝福!");
chardata[200][60]={{"祝你生日快乐!祝你生日快乐!"},{"\nHappybirthdaytoyou!\n"},{"Happybirthdaymydearfriend!\n"},
{"在你面前的台里本,总有一天是很独特!\n"},{"虽然你和我,没办法选,来到世界的某刻。\n"},{"天气寒冷,又或炎热,又或者什么血型和星座!\n"},
{"每年这刻,我对自己说,有生的日子要更快乐!\n"},{"天气寒冷,又或炎热,又或者什么血型和星座!\n"},{"每年这刻,我对自己说,有生的日子要更快乐!\n"},
{"爸爸妈妈辛苦了!谢谢你们为我付出太多!\n"},{"生日祝福,吹灭蜡烛,我要我自己不许哭。\n"},{"长大了一岁变得靠谱,继续走自己的旅程!\n"},
{"又到这一个时刻,幸福的花火,手机祝福收到很多很多。\n"},{"看到最后一条来自你,写着让我感动的话语。\n"},{"亲爱的朋友要经常联络,我们一起来唱这首歌!\n"},
{"祝你生日快乐额!我们一起快乐!\n"}
};
intsign=0;
inti,j,e;
inta;
longtime;
for(i=1,a=I;i<I/2;i++,a--)
{
for(j=(int) ( I-sqrt(II-(a-i)(a-i)) );j>0;j--)
printf("");
for(e=1;e<=2sqrt(II-(a-i)(a-i));e++)
printf("\3");
for(j=(int)
( 2( I-sqrt(II-(a-i)(a-i)) ) );j>0;j--)
printf("");
for(e=1;e<=2sqrt(II-(a-i)(a-i));e++)
printf("\3");
printf("\n");
}
for(i=1;i<80;i++)
{
if(i==25)
{
printf("======祝,生日快乐。======");
i+=30;
}
printf("\3");
}
printf("\n");
for(i=1;i<=R/2;i++)
{
if(i%2||i%3)
continue;
for(j=(int) ( R-sqrt(RR-ii) );j>0;j--)
printf("");
for(e=1;e<=2( sqrt(RR-ii) - (R-2I) );e++)
printf("\3");
printf("\n");
}
for(;;)
{
system("colora");
for(time=0;time<99999999;time++); system("color b");
for(time=0;time<99999999;time++); system("color c");
for(time=0;time<99999999;time++); system("color d");
for(time=0;time<99999999;time++); system("color e");
for(time=0;time<99999999;time++); system("color f");
for(time=0;time<99999999;time++);
system("color 0"); for(time=0;time<99999999;time++);
system("color 1"); for(time=0;time<99999999;time++);
system("color 2"); for(time=0;time<99999999;time++);
system("color 3"); for(time=0;time<99999999;time++);
system("color4");
for(time=0;time<99999999;time++); system("color 5");
for(time=0;time<99999999;time++); system("color 6");
for(time=0;time<99999999;time++); system("color 7");
for(time=0;time<99999999;time++); system("color 8");
for(time=0;time<99999999;time++); system("color 9");
for(time=0;time<99999999;time++); system("color ab");
for(time=0;time<99999999;time++); system("color ac");
for(time=0;time<99999999;time++); system("color ad");
for(time=0;time<99999999;time++); system("color ae");
for(time=0;time<99999999;time++); system("color af");
for(time=0;time<99999999;time++);
printf("%s",data[sign]);
sign++;
}
return0;
}
以上就是关于c++怎样设计简单程序 庆祝生日的 要格式全部的内容,包括:c++怎样设计简单程序 庆祝生日的 要格式、哪位仁兄可以用C语言帮我写一个生日快乐的小程序 就是已输入生日 最后可以出现生日蛋糕的图像、c语言编写一个猜生日程序,向用户显示5张数字卡片,根据回答猜出用户的生日是哪一天等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)