- #include <stdio.h>
-
#include <math.h>
-
#include <conio.h>
-
#include <stdlib.h>
-
int main()
-
{
-
int count,i,j,k;
-
float u1,t1,u2,t2,u3,t3,u4,t4,u5,t5,u6,t6,u7,t7,u9,t9,p,p1,p2,p3,p4,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,a[4],max,b[9],maximum;
-
clrscr();
-
unsigned seed;
-
printf("Enter the value of seed:");
-
scanf("%f",seed);
-
srand(seed);
-
for(u1=0;u1<10000000;u1++)
-
scanf("%4f",rand()/32768);
-
t1=3*u1+4;
-
for(u2=0;u2<10000000;u2++)
-
scanf("%4f",rand()/32768);
-
if(0=<u2)&&(u2<=0.333)
-
t2=4+sqrt(3*u2);
-
else
-
if(0.333=<u2)&&(u2<=1)
-
t2=7-sqrt(6-6*u2);
-
for(u3=0;u3<10000000;u3++)
-
scanf("%4f",rand()/32768);
-
t3=-2.3025*log(1-u3)/0.2;
-
for(u4=0;u4<10000000;u4++)
-
scanf("%4f",rand()/32768);
-
t4=3*u4+4;
-
for(u5=0;u5<10000000;u5++)
-
scanf("%4f",rand()/32768);
-
if(0=<u5)&&(u5<=0.333)
-
t5=4+sqrt(3*u5);
-
else
-
if(0.333=<u5)&&(u5<=1)
-
t5=7-sqrt(6-6*u5);
-
for(u6=0;u6<10000000;u6++)
-
scanf("%4f",rand()/32768);
-
t6=-2.3025*log(1-u6)/0.2;
-
for(u7=0;u7<10000000;u7++)
-
scanf("%4f",rand()/32768);
-
t7=3*u7+4;
-
for(u8=0;u8<10000000;u8++)
-
scanf("%4f",rand()/32768);
-
if(0=<u8)&&(u8<=0.333)
-
t8=4+sqrt(3*u8);
-
else
-
if(0.333=<u8)&&(u8<=1)
-
t8=7-sqrt(6-6*u8);
-
for(u9=0;u9<10000000;u9++)
-
scanf("%4f",rand()/32768);
-
t9=-2.3025*log(1-u9)/0.2;
-
p1=t1+t4+t8;
-
p2=t2+t5+t8;
-
p3=t2+t6+t7+t8;
-
p4=t2+t6+t9;
-
printf("\n p1 is:%3f,p2 is:%3f,p3 is:%3f,p4 is:%3f,p1,p2,p3,p4);
-
count=0;
-
for(i=0;i<4;i++)
-
scanf(p[i]);
-
count++;
-
scanf("%3d",count);
-
printf("\n [count]<=15");
-
scanf("%3f",count);
-
F1=count/10000000;
-
scanf("%3f",F1);
-
printf("\n [count]<=16");
-
scanf("%3d",count);
-
F2=count/10000000;
-
scanf("%3f",F2);
-
printf("\n [count]<=17");
-
scanf("%3d",count);
-
F3=count/10000000;
-
scanf("%3f",F3);
-
printf("\n [count]<=18");
-
scanf("%3d",count);
-
F4=count/10000000;
-
scanf("%3f",F4);
-
printf("\n [count]<=19");
-
scanf("%3d",count);
-
F5=count/10000000;
-
scanf("%3f",F5);
-
printf("\n [count]<=20");
-
scanf("%3d",count);
-
F6=count/10000000;
-
scanf("%3f",F6);
-
printf("\n [count]<=21");
-
scanf("%3d",count);
-
F7=count/10000000;
-
scanf("%3d",F7);
-
printf("\n [count]<=22");
-
scanf("%3d",count);
-
F8=count/10000000;
-
scanf("%3f",F8);
-
printf("\n [count]<=23");
-
scanf("%3d",count);
-
F9=count/10000000;
-
scanf("%3f",F9);
-
printf("\n [count]<=24");
-
scanf("%3d",count);
-
F10=count/10000000;
-
scanf("%3f",F10);
-
printf("\n [count]<=25");
-
scanf("%3d",count);
-
F11=count/10000000;
-
scanf("%3f",F11);
-
printf("\n [count]<=26");
-
scanf("%3d",count);
-
F12=count/10000000;
-
scanf("%3f",F12);
-
printf("\n [count]<=27");
-
scanf("%3d",count);
-
F13=count/10000000;
-
scanf("%3f",F13);
-
printf("\n [count]<=28");
-
scanf("%3d",count);
-
F14=count/10000000;
-
scanf("%3f",F14);
-
printf("\n [count]<=29");
-
scanf("%3d",count);
-
F15=count/10000000;
-
scanf("%3d",F15);
-
printf("\n [count]<=30");
-
scanf("%3d",count);
-
F16=count/10000000;
-
scanf("%3f",F16);
-
count=0
-
for(j=0;j<4;j++)
-
scanf(p[j]);
-
count++;
-
scanf("%3d",count);
-
for(p=0;p<4;p++)
-
scanf("\n%3f",a[p]);
-
max=a[0];
-
for(p=1;p<4;p++)
-
{if(a[p]>max)
-
{max=a[p];}}
-
printf("The greatest path is: %f",max);
-
count=0;
-
for(k=0;k<9;k++)
-
scanf(t[k]);
-
count++;
-
scanf("%3d",count);
-
for(t=0;t<9;t++)
-
scanf("\n%3f",b[t]);
-
maximum=b[0];
-
for(t=1;t<9;t++)
-
{if(b[t]>max)
-
{maximum=b[t];}}
-
printf("The greatest activity is: %f",maximum);
-
-
getch();
-
return 0;
-
}
1 8014
Invalid indirection means you are using a variable where you should be using the address of the variable.
Check out your scanf calls.
Please use code tags.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: robin.pain |
last post by:
I was looking for GBS's phonetic dictionary when I came across an
American who was having problems with it... of course, it can never
work for... Geordies, Irish, Brummies, Strynes, South ifrrikuns...
|
by: Nobody |
last post by:
excuse the "windows" code below, but this is a C++ question... or maybe a C.
Anyways, I want a function where I can pass in an array of strings (variable
count, variable size), so I defined this:...
|
by: blimeyoreilly |
last post by:
Hi
I've a small problem .. can anyone figure it out?
I am working in VS.NET in C++ with MFC. I have a CWinApp-based class
called CTestHarnessApp. I keep getting the 'differs in levels of...
|
by: spoilsport |
last post by:
Ive got to write a multi-function program and I'm plugging in the
functions but I keep getting this error from line 40. Im new to this
and cant find an answer anywhere.
Sam
#include...
|
by: Roman Mashak |
last post by:
Hello, All!
I assume my post isn't offtopic here.
I used 'valgrind' utility (guess plenty if you know and use it) for my
application and I got the message "Invalid read of size 1" regarding...
|
by: santosh |
last post by:
Hi all,
In the following program I allocate a block of pointers to type char,
initialised to zero. I then point each of those pointers to a block of
allocated memory of fixed size (33 bytes). A...
|
by: Marty |
last post by:
I am wondering what is the difference in the placement between the 2
uses of the indirection operator? Or is there a difference?
AcDbBlockTable *pBlockTable = NULL;
AcDbDatabase* pDB =...
|
by: Angus |
last post by:
I am using a global which is a void*
I have it defined in one file as:
void* hFlag;
and one other header file as:
extern void* hFlag;
But I get this compile error:
|
by: william |
last post by:
When implementing Linked list, stack, or trees, we always use pointers
to 'link' the nodes.
And every node is always defined as:
struct node
{
type data; //data this node contains
...
node *...
|
by: imaloner |
last post by:
I am posting two threads because I have two different problems, but both have the same background information.
Common Background Information:
I am trying to rebuild code for a working,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |