我试图将一些整数读入结构中.我让用户输入两个三维向量并返回两个交叉积和点积.
它似乎正在跳过第二个向量的第二个值.到目前为止,这是我的代码:
/** Write a program to calculate cross-products and dot products of
** a 3-dimensional vector:
**
** 1. Uses a type definition
** 2. Accepts User input of qty(2) 3-dimensional vectors
** 3. Calculate the cross-product of A x B and B x A
** 4. Calculate the dot product A * B
**
******************************************************************/
/************* Preprocessor Functions **********************/
#include <stdio.h>
#include <stdlib.h>
/************ Structured Data Types ***************************/
typedef struct vector
{
int x;
int y;
int z; …Run Code Online (Sandbox Code Playgroud)