没有注明单镇败位,输入者无所适从
#include <stdio.h>
int main()
{
int height//御差颤定义身高,单位 cm
int money//定义存款,单位 万元
printf("请输身高cm和存款金额万元:\n")
scanf("%d,%d",&height,&money)
if(height>=180||money>=100)//如果身高大于等于180cm或者存款大于等于100万!
printf("符合要求\n")
else
printf("不符合要求\n")
return 0
}
// 记得多给点分哦,很难写的。// C
#include <stdio.h>
int strnmerge(char*str,int n,char const*s1,char const*s2){
while(n > 0) {
if(!(*s1) && !(*s2)) break
if(*s1 && n > 0) {
*str++ = *s1++
--n
}
if(*s2 && n > 0) {
*str++ = *s2++
--n
}
}
*str = '\0'
}
int main() {
char s1[] 悔早= "aaaa"
char s2[] = "bbbbbbbbb"
char str[100]
strnmerge(str, 10, s1, s2)
printf("s1 = %s\n", s1)
printf("s2 = %s\n", s2)
printf("str = %s\n", str)
return 0
}
// C++
#include <iostream>
using namespace std
int strnmerge(char*str,int 腔汪n,char const*s1,char const*s2){
while(n > 0) {
if(!(*s1) && !(*s2)) break
if(*s1 && n > 0) {
*str++ = *s1++
--n
}
if(*s2 && n > 0) {
*str++ = *s2++
--n
}
}
*str = '\0'
}
int main() {
char s1[] = "aaaa"
char s2[] = "bbbbbbbbb"
char str[100]
strnmerge(str, 10, s1, s2)
cout << "s1 = " 伍前仔<< s1 << endl
cout << "s2 = " << s2 << endl
cout << "str = " << str << endl
return 0
}
#include <stdio.h>#include <time.h>
int main()
{
int 悉岩镇睁粗a,b
srand(time(NULL))
a=rand()
scanf("%d",&b)
a==b?printf("true"):printf("false"枣搏)
return 0
}
//运行示例:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)