#include<stdio.h>
#include<math.h>
int main()
{
int n, digit, i=0, sum= 0;
scanf("%d", &n);
while(n>0)
{
digit = n % 10;
i++;
int j = i-1;
if(digit%2==i%2)
......................
阅读全部
|
初学者6
贴于 2018年3月26日 20:58
hide
bbsi
#include<stdio.h>
int main()
{
int i, m ,n;
m = 0;
n = 0;
scanf("%d", &i);
while(i != -1)
{
if(i%2==0)
{
m++;
......................
阅读全部
|
初学者6
贴于 2018年3月26日 20:57
hide
bbsi
#include<stdio.h>
int main()
{
int n, m;
scanf("%d %d", &n, &m);
int i;
int sum = 0;
int count = 0;
for(i = 2; count<=m; i++)
{
int j;
int isPrime = 1;
......................
阅读全部
|
初学者6
贴于 2018年3月26日 20:53
hide
bbsi
u8 RxBuff[20];
u8 RxBuffed[20];
u8 RxCount;
u8 RxLength;
void USART2_IRQHandler(void)
{
u8 i;
if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
{
USART_ClearITPendingBit(USART2, USART_IT_RXNE);
RxBuff[RxCount++] = USART_ReceiveData(USART2);
......................
阅读全部
|
gugoen
贴于 2018年3月26日 16:49
hide
bbsi
u8 RxCounter = 0; //接收当前位
u8 RxOver = 0; //字符串接收完成
u8 RxLength = 0; //字符串实际长度
u8 RxBuffer[20]; //接收缓存
u8 RxBuffed[20]; //接收完成字符串
void USART2_IRQHandler(void)
{
u8 i;
if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
{
......................
阅读全部
|
gugoen
贴于 2018年3月25日 21:30
hide
bbsi
根据下面给出的求根公式,计算并输出一元二次方程的两个实根,要求精确到小数点后4位。程序中所有浮点数的数据类型均为float.
提示:
1. 计算平方根的数学函数为sqrt()。
2. 使用数学函数,需要在程序开头加上编译预处理指令 #include <math.h>
以下为程序运行结果示例
x1=-0.5000
x2=-1.0000
......................
阅读全部
|
xt1827921096
贴于 2018年3月24日 19:47
hide
bbsi
根据下面给出的求根公式,计算并输出一元二次方程的两个实根,要求精确到小数点后4位。程序中所有浮点数的数据类型均为float.
提示:
1. 计算平方根的数学函数为sqrt()。
2. 使用数学函数,需要在程序开头加上编译预处理指令 #include <math.h>
以下为程序运行结果示例
x1=-0.5000
x2=-1.0000
......................
阅读全部
|
xt1827921096
贴于 2018年3月24日 19:45
hide
bbsi
#include <stdio.h>
#include <math.h>
int main(void)
{
float x0, x1, x2, y0, y1, y2;
do
{
printf("Please input x1, x2: ");
scanf("%f,%f", &x1, &x2);
y1 = x1 * x1 * x1 - 3 * x1 * x1 + x1 + 1 = 0;
......................
阅读全部
|
LovelyFellas
贴于 2018年3月20日 09:59
hide
bbsi
#include<stdio.h>
#define maxsize 100
typedef struct{
int num;
float score;
}stu;
typedef stu datatype;
typedef struct{
datatype data[maxsize];
int length;
}seqlist;
void creatlist(seqlist *l)
......................
阅读全部
|
艺雯
贴于 2018年3月18日 11:33
hide
bbsi